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: last inserted id

Re: last inserted id

From: Martin Drautzburg <drautzburg_at_altavista.net>
Date: 07 Apr 2001 02:41:33 +0200
Message-ID: <87ae5to81u.fsf@altavista.net>

"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> writes:

> On Oracle 8.0 and before you would use select <sequence>.nextval into
> <somevariable> from dual; insert into foo values (<somevariable>) etc.

Preferably you would let a trigger determine the sequence.nextval. Then you would have to get sequence.currval to get the ID of the last inserted record. If you have several tables you may want to use one sequence for all of them if you don't want to currval different sequences for different tables. Received on Fri Apr 06 2001 - 19:41:33 CDT

Original text of this message

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