Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: IDENTITY?
Hi,
take a look at sequences:
Create Sequence SEQ_YOUR_TABLE_PK ;
create or replace trigger tI_YOUR_TABLE
BEFORE INSERT
on YOUR_TABLE
for each row
begin
SELECT SEQ_YOUR_TABLE_PKD.NEXTVAL INTO :new.PK FROM dual ;
end;
/
On Tue, 7 Apr 1998 22:11:11 -0700, Graham Miller <gjm_at_Xenon.Stanford.EDU> 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
>
--
Regards
Matthias Gresz :-)
GreMa_at_T-online.de Received on Wed Apr 08 1998 - 07:11:28 CDT
![]() |
![]() |