Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: INSERT, UPDATE and how to catch rowid
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
![]() |
![]() |