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: Q: INSERT, UPDATE and how to catch rowid

Re: Q: INSERT, UPDATE and how to catch rowid

From: Borivoj Tydlitat <btydlitat_at_merlin.cz>
Date: 1997/10/01
Message-ID: <3431FC73.C80@merlin.cz>#1/1

Gerard H. Pille wrote:
> Are you sure about the second "we" in "We can get the rowid of the last row
> we inserted (updated) into the table"?
>
> I was afraid that I could get the rowid of someone else's insert, if it
> occurred between mine and the retrieval of the package variable.
 ...
> > We can get the rowid of the last row we inserted (updated) into the table
> > quite easily...
> >
> > try the following script, the concept is, we will use a package to maintain a
> > state; a trigger to populate the state. An after insert for each row trigger
> > can push the rowid of the newly inserted row into a package variable for us. We
> > can read the package variable and use it:

Package variables are instanced by session, and as far as I know, there is nothing like multiple threads of execution in Oracle(7) session. So there is nobody else, who could overwrite my global var except myself. Of course, I must INSERT records by one, not by insert select, and always retrieve the ROWID value.

Borivoj Tydlitat Received on Wed Oct 01 1997 - 00:00:00 CDT

Original text of this message

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