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: auto increment of primary key in ORACLE

Re: auto increment of primary key in ORACLE

From: Yann CAUCHARD <yann.cauchard_at_online.fr>
Date: Mon, 09 Aug 1999 21:28:10 GMT
Message-ID: <01bee2ad$e8542200$42391bd4@bsy>


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

Original text of this message

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