473,388 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 13209

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Roger Withnell | last post by:
I'm inserting a new record into an MS SQL database table and I want to obtain the new records autonumber immediately afterwards, as follows: MadminRS.CursorLocation = adUseServer...
1
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
2
by: (Pete Cresswell) | last post by:
This doesn't work because the first INSERT is creating multiple records for multiple projects. @@IDENTITY, then, contains the Identity column value for the last tblWeekReportedLine record...
2
by: DotNetJunkies User | last post by:
How can I get after a dataset update the new row primary key value??? --- Posted using Wimdows.net NntpNews Component - Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup...
1
by: dusty | last post by:
Hi, I'll try to simplify the problem: I created a table "TestTable" in a database on the SQL server. The first column, 'id', is the primary key with a auto-increment identity. I want to work...
17
by: Rico | last post by:
Hello, I am in the midst of converting an Access back end to SQL Server Express. The front end program (converted to Access 2003) uses DAO throughout. In Access, when I use recordset.AddNew I...
8
by: Dave | last post by:
I have a form with a label that should show an invoice number. The invoice number should be generated by sql Server using an autoincremented technique. However, after reading several articles, it...
5
by: Veeru71 | last post by:
Given a table with an identity column (GENERATED BY DEFAULT AS IDENTITY), is there any way to get the last generated value by DB2 for the identity column? I can't use identity_val_local() as...
4
by: Carlos San Miguel | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.