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 column?

Re: Identity column?

From: John F. Keaveney <johnkeaveney_at_targusinfo.com>
Date: Fri, 22 Oct 1999 15:16:25 -0700
Message-ID: <7uqo3c$lur$1@ffx2nh3.news.uu.net>


I implement IDENTITY by creating a sequence and an on insert trigger e.g.

>CREATE SEQUENCE SEQ_MYTAB_IDENT ;

>CREATE OR REPLACE TRIGGER MYTAB_IDENT BEFORE INSERT ON MYTAB
REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN
   select seq_mytab.nextval into :new.identity from dual ; END ; Good luck,

    John

Bill Weaks <bill_at_indmolding.nospam.com> wrote in message news:3810DBA0.66C5AFCF_at_indmolding.nospam.com...
> Sounds silly, I suppose, but I can't find documentation on how to create
> an IDENTITY column in Oracle 7!
>
> I see ROWID, but that doesn't cut it.
>
> My experience thus far has been with MS SQL 6.5+, and they have a way to
> create an autoincrementing field in a table.
>
> Could somebody shed some light, please?
>
> Thanks
>
Received on Fri Oct 22 1999 - 17:16:25 CDT

Original text of this message

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