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
-- Chrysalis <cellis_at_iol.ie> wrote in article <33722487.78FA_at_iol.ie>...Received on Sun May 11 1997 - 00:00:00 CDT
> 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.
I suppose that some source table modifications are must be made. You just add column such D_WHEN, and trigger on INSERT, UPDATE which must set D_WHEN= SYSDATE. Best wishes Bors