Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Error: 'ORA-01400: cannot insert NULL into ('
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;
/
-- http://www.mgogala.comReceived on Fri Jan 20 2006 - 21:30:39 CST
![]() |
![]() |