Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get the last insert id

Re: How to get the last insert id

From: Norbert Pürringer <thalion77_at_graffiti.net>
Date: Sat, 8 Sep 2007 11:20:33 +0200
Message-ID: <fbtpgn$dhe$1@newsreader2.utanet.at>


Hello once more!

If I use a sequence, it's of course no problem to get the ID of the last inserted dataset. But imagine, that the primary key consists of GUID values and the default value of the primary key column is New_Guid. So a new dataset will produce a new GUID value which I want to use in the next statement. But how?

You must consider, that I work with the database via ADO.NET. After updating the new dataset, reading out the value of the GUID primary key results to DBNull instead of giving me the new GUID value. So I think the only way is to execute another SQL statement retrieving me the new value. Other database systems provide SQL functions like Scope_Idendity or LastInsertID.

Kind regards,
Norbert Received on Sat Sep 08 2007 - 04:20:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US