Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: IDENTITY?

Re: IDENTITY?

From: Ken Leach <KLeach_at_ids.net>
Date: Wed, 08 Apr 1998 11:17:06 -0400
Message-ID: <352B94F2.D264CDC0@ids.net>


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

Original text of this message

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