| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: Last Identity added
yatuchabe_at_hotmail.com (Carlos San Miguel) wrote in message news:<b5abf2cd.0406031659.7e18ed17_at_posting.google.com>...
> Hi, I'm going to be using Oracle with a customer. I will access
> Informix with ODBC. All the tables have a serial column, this is the
> ID for the record. I need to know how I can get the value of the
> serial column for the last record inserted. A stored procedure maybe?
>
> TIA
> Carlos San Miguel
You could use the 'returning <column_name> clause' of the insert
statement, if you run the insert inside a stored procedure.
If you are using sequences for the id column (which you should do),
you could have a stored procedure running
select <sequence>.currval from dual;
only.
Sybrand Bakker
Senior Oracle DBA
Received on Fri Jun 04 2004 - 06:22:38 CDT
![]() |
![]() |