Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: An Autonumber field in Oracle
"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
![]() |
![]() |