469,110 Members | 1,957 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

value of last identity inserted

Hi, I'm going to be using Oracle with a customer. I will access
Oracle with ODBC. All the tables have an Identity column, this is the
ID for the record. I need to know how I can get the value of the
Identity column for the last record inserted. A stored procedure maybe?

TIA
Carlos San Miguel
Jul 19 '05 #1
4 12968

"Carlos San Miguel" <ya*******@hotmail.com> wrote in message
news:b5**************************@posting.google.c om...
Hi, I'm going to be using Oracle with a customer. I will access
Oracle with ODBC. All the tables have an Identity column, this is the
ID for the record. I need to know how I can get the value of the
Identity column for the last record inserted. A stored procedure maybe?

TIA
Carlos San Miguel


select? How about the max number if it really is monotonically increasing.
Are you asking how to write a select statement?
Jim
Jul 19 '05 #2
I'm actually trying to get the last serial number assigned to a row
inserted by the current session. With MSSQL you can get it with select
@@IDENTITY, with INformix you can use SELECT DBINFO('sqlca.sqlerrd1')
FROM systables where tabid = 1;
How can I do the same with Oracle?

TIA
Carlos San Miguel
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
Oracle with ODBC. All the tables have an Identity column, this is the
ID for the record. I need to know how I can get the value of the
Identity column for the last record inserted. A stored procedure maybe?

TIA
Carlos San Miguel

Jul 19 '05 #3

"Carlos San Miguel" <ya*******@hotmail.com> wrote in message
news:b5**************************@posting.google.c om...
I'm actually trying to get the last serial number assigned to a row
inserted by the current session. With MSSQL you can get it with select
@@IDENTITY, with INformix you can use SELECT DBINFO('sqlca.sqlerrd1')
FROM systables where tabid = 1;
How can I do the same with Oracle?

TIA
Carlos San Miguel
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
Oracle with ODBC. All the tables have an Identity column, this is the
ID for the record. I need to know how I can get the value of the
Identity column for the last record inserted. A stored procedure maybe?

TIA
Carlos San Miguel


Look up the returning clause in the select statement.
Jim
Jul 19 '05 #4
Jim Kennedy wrote:
"Carlos San Miguel" <ya*******@hotmail.com> wrote in message
news:b5**************************@posting.google.c om...
I'm actually trying to get the last serial number assigned to a row
inserted by the current session. With MSSQL you can get it with select
@@IDENTITY, with INformix you can use SELECT DBINFO('sqlca.sqlerrd1')
FROM systables where tabid = 1;
How can I do the same with Oracle?

TIA
Carlos San Miguel
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
Oracle with ODBC. All the tables have an Identity column, this is the
ID for the record. I need to know how I can get the value of the
Identity column for the last record inserted. A stored procedure maybe?

TIA
Carlos San Miguel

Look up the returning clause in the select statement.
Jim

And sequences, and the combination with a trigger

--

Regards,
Frank van Bortel

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by DotNetJunkies User | last post: by
4 posts views Thread by Carlos San Miguel | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.