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

Home -> Community -> Usenet -> c.d.o.server -> Re: Get rownum or rowid in insert URGENTT!!!!

Re: Get rownum or rowid in insert URGENTT!!!!

From: <karsten_schmidt8891_at_my-deja.com>
Date: Fri, 05 Nov 1999 14:56:00 GMT
Message-ID: <7vur5k$o3f$1@nnrp1.deja.com>


Hi,

 you can get the rowid before the transaction is committed. (see my earlier post.) of course, it will be bogus, if the transaction is rolled back.

 instead of stuffing them to dbms_output you could also insert them into another table - this will be committed together with your original transaction. that way you won't get bogus rowid's due to rollback.

 be aware of race-conditions though, the row may be deleted before you get to process the rowid.

 insert .... returning is another (better, more efficient) way of doing it if you can get at the source code.

Karsten

In article <01bf2774$e12919c0$2c289a0a_at_apollo>,   "Peter Laursen" < ptl_at_edbgruppen.dk> wrote:
> > From David P, Glasgow, Scotland, UK
> >
> >
> > Carlos - you probably wouldn'r be able to get the ROWID until you
COMMIT
> > 'ed.
> >
>
> HI David
>
> Both Billy Verreynne above and you mentions that you cant get the
rowid
> before the insert is commited.
> I think that with <insert into t values(...) returning rowid into
my_var> I
> can get the rowid fine.
> What am I missing here?
>
> Peter Laursen
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Nov 05 1999 - 08:56:00 CST

Original text of this message

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