welcome: please sign in
location: OracleDatenbank / AutoIncrement

{{{ops$tkyte@8i> create table t ( x int primary key, y int ); Table created.

ops$tkyte@8i> create sequence myseq; Sequence created.

ops$tkyte@8i> create trigger t_trigger

Trigger created. }}} I used "if ( :new.x is null ) then..." in order to allow the application to supply a value for the primary key if it desires. You may leave that off -- it would then assign a unique value for EVERY row {{{ops$tkyte@8i> insert into t (x,y) values (-1,2); 1 row created.

ops$tkyte@8i> insert into t (y) values (3); 1 row created.

ops$tkyte@8i> select * from t;



ops$tkyte@8i> }}}

OracleDatenbank/AutoIncrement (last edited 2008-07-14 09:55:46 by localhost)