Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: auto increment of primary key in ORACLE
Hi, the solution is to use a trigger with a sequence :
in a before insert trigger on emp, you assign the NEXTVAL of the seq to the empnr field.
If you need complete syntax, just answer to Yann.cauchard_at_free.fr (i have it at my office...)
Share what you know, laern what you don't
wolfgang karrer <wolfgang.karrer_at_ce.uni-linz.ac.at> a écrit dans l'article
<37AE7559.7592CB7C_at_ce.uni-linz.ac.at>...
> Hi,
>
> is it possible to auto increment the primary key of a table, like
>
> table emp
> empnr INTEGER primary key
>
> thanx for helping me!
>
Received on Mon Aug 09 1999 - 16:28:10 CDT
![]() |
![]() |