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: <Tim_Cuthbertson_at_sonat.com>
Date: Mon, 09 Aug 1999 12:22:39 GMT
Message-ID: <7omh67$a8a$1@nnrp1.deja.com>


In article <37AE7559.7592CB7C_at_ce.uni-linz.ac.at>,   wolfgang karrer <wolfgang.karrer_at_ce.uni-linz.ac.at> wrote:
> This is a multi-part message in MIME format.
> --------------772672DB7F2C90E28CD4141C
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> is it possible to auto increment the primary key of a table, like
>
> table emp
> empnr INTEGER primary key
>
> thanx for helping me!
>
> --------------772672DB7F2C90E28CD4141C
> Content-Type: text/x-vcard; charset=us-ascii;
> name="wolfgang.karrer.vcf"
> Content-Transfer-Encoding: 7bit
> Content-Description: Card for wolfgang karrer
> Content-Disposition: attachment;
> filename="wolfgang.karrer.vcf"
>
> begin:vcard
> n:Karrer;Wolfgang
> tel;fax:0732 68 17 85
> tel;home:0699 134 18 469
> tel;work:0732 2468 7104
> x-mozilla-html:FALSE
> adr:;;;;;;
> version:2.1
> email;internet:wolfgang.karrer_at_ce.uni-linz.ac.at
> fn:Wolfgang Karrer
> end:vcard
>
> --------------772672DB7F2C90E28CD4141C--
>
>

You have to create a separate sequence object, then when you are inserting to the table, the value for your empnr column should be specified as sequence_name.next_val

Tim

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Aug 09 1999 - 07:22:39 CDT

Original text of this message

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