469,148 Members | 1,323 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,148 developers. It's quick & easy.

Last Identity added

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
Jul 19 '05 #1
1 2561
ya*******@hotmail.com (Carlos San Miguel) wrote in message news:<b5**************************@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
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ann | last post: by
1 post views Thread by Jerry Camel | last post: by
2 posts views Thread by Wayne Wengert | last post: by
37 posts views Thread by spam.noam | last post: by
9 posts views Thread by Eitan M | last post: by
5 posts views Thread by Marko | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.