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: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Sat, 21 Jan 2006 03:30:39 GMT
Message-Id: <pan.2006.01.21.03.30.38.880011@sbcglobal.net>


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.com
Received on Fri Jan 20 2006 - 21:30:39 CST

Original text of this message

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