Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Error: 'ORA-01400: cannot insert NULL into ('

Re: Error: 'ORA-01400: cannot insert NULL into ('

From: Eric de Redelijkheid <ericdere_at_xs4all.nl>
Date: Sat, 21 Jan 2006 15:47:46 +0100
Message-ID: <43d24991$0$11067$e4fe514c@news.xs4all.nl>


Anno Domini 21-1-2006 4:30, Mladen Gogala sprak aldus:
> On Fri, 20 Jan 2006 16:26:20 -0800, srhari wrote:
>
>
>> I'm trying to insert a record into a table, but getting the error -
>> 'ORA-01400: cannot insert NULL into (....'. The table structure is:
>>
>> recnum number primary key,
>> ap# varchar2,
>> program varchar2
>>
>
> create sequence tblname_seq start with 1 nomaxvalue nocycle cache 256;
>
> create or replace trigger tbl_populate_pk
> before insert on <table name>
> for each row
> begin
> select tblname_seq.nextval
> into :new.recnum
> from dual;
> end;
> /
>
>

insert into history values (tblname_seq.nextval, 'something','anything')

no need for triggers Received on Sat Jan 21 2006 - 08:47:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US