Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Get the primary key of the last record added
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
![]() |
![]() |