Re: Auto increment primary key
From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/06/03
Message-ID: <960017330.19310.0.pluto.d4ee154e_at_news.demon.nl>#1/1
Date: 2000/06/03
Message-ID: <960017330.19310.0.pluto.d4ee154e_at_news.demon.nl>#1/1
create sequence product_seq start with 1 increment 1
/
create or replace trigger product_insert before insert for each row
begin
select productseq.nextval
into :new.product_id
from dual;
end;
/
etc...
Hth,
Sybrand Bakker, Oracle DBA
jAw <jawax_at_optushome[nospam].com.au> schreef in berichtnieuws
B_1_4.2429$291.7330_at_news1.belrs1.nsw.optushome.com.au...
> probably a basic question, but i cant find out how to do it ... so if
anyone
> can help out it would be most appreciated
>
> ie., how to auto increment a primary key eg. for product_id, customer_id
> etc.
>
> thanks heaps
>
> jawax_at_optushome_nospam.com.au
>
>
Received on Sat Jun 03 2000 - 00:00:00 CEST