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

Home -> Community -> Usenet -> c.d.o.server -> Re: An Autonumber field in Oracle

Re: An Autonumber field in Oracle

From: Haximus <e_at_t.me>
Date: Fri, 25 Feb 2005 10:37:29 GMT
Message-ID: <JdDTd.5769$_G.372@clgrps12>


"Lars Gr?tteland" <lgrottland_at_yahoo.com> wrote in message news:cd032a36.0502250219.414c342e_at_posting.google.com...
> Hello!
>
> I'm a newbie to oracle and wondering how to have a autonumber field in
> Oracle. Do I have to set a trigger to that item?

You would define a SEQUENCE, then use it to generate sequential values to populate your column (typically the PK). You could create triggers to insert the generated values... there are advantages and disadvantages... maintaining triggers is extra work but simplifies insertion, on the other hand sometimes you need to know the sequence value before insertion... so it all depends on what you are doing. Received on Fri Feb 25 2005 - 04:37:29 CST

Original text of this message

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