Path: text.usenetserver.com!out01b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!post01.iad01!not-for-mail
Date: Sun, 09 Sep 2007 09:54:19 -0700
From: DA Morgan <damorgan@psoug.org>
Organization: Puget Sound Oracle Users Group
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.misc
Subject: Re: How to get the last insert id
References: <1189179184.160964.8080@50g2000hsm.googlegroups.com> <1189181804.494405.78220@19g2000hsx.googlegroups.com> <fbtpgn$dhe$1@newsreader2.utanet.at> <fc0nip$80l$3@news4.zwoll1.ov.home.nl>
In-Reply-To: <fc0nip$80l$3@news4.zwoll1.ov.home.nl>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <1189356851.211985@bubbleator.drizzle.com>
Cache-Post-Path: bubbleator.drizzle.com!unknown@216.162.218.178
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
Lines: 44
X-Complaints-To: abuse@csolutions.net
Xref: usenetserver.com comp.databases.oracle.misc:249809
X-Received-Date: Sun, 09 Sep 2007 12:54:11 EDT (text.usenetserver.com)

Frank van Bortel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Norbert Pürringer wrote:
>> 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 
>>
>>
> Lookup INSERT INTO ... RETURNING
> http://tahiti.oracle.com.
> 
> Without doubt, Daniel has some examples in his library, too,
> but only 11.0, of course :)
> But you'll get the idea
> - --
> Regards,
> Frank van Bortel

When I mark something in the library 11g that indicates I have tested it
in 11g and it is functional and supported. If the functionality exists
in previous versions it will work there too.

In the case of the RETURNING clause it goes back many versions.
-- 
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
