Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: IDENTITY?
Use a sequence...
and create an on-insert trigger for that table that will populate the PK row
from the sequence.
CREATE SEQUENCE Table1_Sequence INCREMENT BY 1 START WITH 10; CREATE TRIGGER Tabel1_BI BEFORE INSERT ON Table1 Begin
:new.col1:= Table1_Sequence.NextVal; End;
That was from memory, you should check the syntax. There is also ROWID's that Oracle stores for you, but they could change.
-Ken Leach
Shoreline Software
Graham Miller wrote:
> Hello all,
> Is there any way to get Oracle7 to create a unique value for a given
> column when a row is inserted (like the IDENTITY feature in Sybase)? Any
> help would be appreciated (by email, please).
>
> later,
> graham
>
> graham miller "Computers are useless. They can only
> gjm_at_cs.stanford.edu give you answers." -- Pablo Picasso
Received on Wed Apr 08 1998 - 10:17:06 CDT
![]() |
![]() |