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: Autoincremented id - how do I read it after insert?

Re: Autoincremented id - how do I read it after insert?

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Wed, 1 Sep 1999 21:05:47 GMT
Message-ID: <37CD952B.E9A18F01@edcmail.cr.usgs.gov>


After you insert the record and use the sequence_name.nextval for the id, you can get that value by querying sequence_name.currval.

HTH,
Brian

kev wrote:
>
> Hi,
>
> I have autoincremented id fields on several tables (using triggers and
> sequences).
> For some of them, I need to know the id value of the record I have just
> inserted, so that I can then insert a reference to that record in a
> 'link' table (resolved many-many links). What's the best way of doing
> this?
>
> TIA,
>
> kev
Received on Wed Sep 01 1999 - 16:05:47 CDT

Original text of this message

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