Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Best way to make query/update sequence atomic
I have a PL/SQL stored procedure which does a SELECT to test for the
existence of a row satisfying a set of criteria, then either updates the
existing row or inserts a new one. How do I ensure that two concurrent
sessions don't both get 'no row found' and try to do the insert? Is there a
standard technique for doing this? At present the only solution I can see is
to use DBMS_LOCK to ensure that only one instance of the SP is executing at
any time.
Apologies if this is an entry-level question - any suggestions appreciated.
Adrian Bowen Received on Fri Aug 27 1999 - 02:57:26 CDT