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 the RowID of the last insert

Re: Get the RowID of the last insert

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 25 Mar 2007 11:35:07 -0700
Message-ID: <1174847707.672878.297200@y66g2000hsf.googlegroups.com>

On Mar 25, 12:43 am, "Ana C. Dent" <anaced..._at_hotmail.com> wrote:

> "Sam Hwang" <sam..._at_gmail.com> wrote in news:1174797005.498751.181200
> @y66g2000hsf.googlegroups.com:
>
> > Hi,
> > How to get the rowId of the last insert?
>
> use RETURNING

Warning - Rowid's can change. In some cases it is possible for a rowid to be reused within extremely tight periods of time so take care that the data is either retrieved using select for update or that no deletes take place between the fetch to get the rowid and any update or delete done using the rowid. In some applications it is advisible to verity the row fetched by rowid is the same row that was initially fetched (same key).

The target table being an IOT or a paritioned table with row movement enabled should be considered in application design.

Just a couple of points to keep in mind.

Received on Sun Mar 25 2007 - 13:35:07 CDT

Original text of this message

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