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 -> Best way to make query/update sequence atomic

Best way to make query/update sequence atomic

From: Adrian Bowen <adrian_at_raptor.win-uk.net>
Date: Fri, 27 Aug 1999 08:57:26 +0100
Message-ID: <7q5gl1$7pq$1@laura.pcug.co.uk>


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

Original text of this message

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