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 primary key of the last record added

Re: Get the primary key of the last record added

From: Chrysalis <cellis_at_iol.ie>
Date: 1997/05/08
Message-ID: <33722487.78FA@iol.ie>#1/1

Allen Kirby wrote:
>
> Bill Biesty wrote:
> >
> > snip
> >
> >
> <snip>
>
> Bill,
> I think you may have misunderstood the question (or maybe I did!).
> The question was how to find out which row in a table was the last
> to be inserted.
>
> snip
>
>

Another possibility which speeds up the retrieval is to have an on-insert trigger which *updates* a single row in another table with the primary key of the inserted row.

Retieving the latest row then requires a single row access plus a single primary-key indexed access to the main table.

However, this falls down if there is heavy insert activity by a number of concurrnt users because of contention on the updated single row, Useful in some circumstances, however,

Hope this helps.

Chrysalis. Received on Thu May 08 1997 - 00:00:00 CDT

Original text of this message

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