Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: last inserted id
"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
![]() |
![]() |