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 4 13222
"Carlos San Miguel" <ya*******@hotm ail.com> wrote in message
news:b5******** *************** ***@posting.goo gle.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
select? How about the max number if it really is monotonically increasing.
Are you asking how to write a select statement?
Jim
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.s qlerrd1')
FROM systables where tabid = 1;
How can I do the same with Oracle?
TIA
Carlos San Miguel ya*******@hotma il.com (Carlos San Miguel) wrote in message news:<b5******* *************** ****@posting.go ogle.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
"Carlos San Miguel" <ya*******@hotm ail.com> wrote in message
news:b5******** *************** ***@posting.goo gle.com... 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.s qlerrd1') FROM systables where tabid = 1; How can I do the same with Oracle?
TIA Carlos San Miguel ya*******@hotma il.com (Carlos San Miguel) wrote in message
news:<b5******* *************** ****@posting.go ogle.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
Jim Kennedy wrote: "Carlos San Miguel" <ya*******@hotm ail.com> wrote in message news:b5******** *************** ***@posting.goo gle.com...
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.s qlerrd1') FROM systables where tabid = 1; How can I do the same with Oracle?
TIA Carlos San Miguel
ya*******@hot mail.com (Carlos San Miguel) wrote in message
news:<b5******* *************** ****@posting.go ogle.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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
MadminRS.CursorType = adOpenKeyset
MadminRS.LockType = adLockOptimistic
MadminRS.Open "NavBar", objConn, , , adCmdTable
MadminRS.AddNew
MadminRS("Url") =...
|
by: PT |
last post by:
I got a problem. And thats.....
First of all, I got these three tables.
------------------- ------------------ ----------------------
tblPerson tblPersonSoftware tblSoftware
------------------- ------------------ ----------------------
PID PName PID* SID* SID SWName
--- ...
|
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 inserted.
Consequently, all the hours records are then associated with
that last value.
The source work table, #EstimateLines, is a pivoted...
|
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 engine supports Post Alerts, Ratings, and Searching.
|
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 connection-less, so I made my dataset where I populated a table with the data from the TestTable. When I insert a new row with the .NewRow() method, the...
| |
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 can retrieve the autonum value for the
new record. This doesn't occur with SQL Server, which of course causes an
error (or at least in this code it...
|
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 seems that I can only retrieve
this value after an INSERT has been done in the database. I want to find out
what this autoincremented before an...
|
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 the INSERTS are happening in a
different session.
Eg, We have the following table....
|
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 the
Identity column for the last record inserted. A stored procedure maybe?
TIA
Carlos San Miguel
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |