Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 8 and locked rows
On Thu, 29 Jan 1998 12:08:05 -0800, "Pascal =?iso-8859-1?Q?Paradis=2DTh=E9berge?=" <pascal_at_ia-us.com> wrote:
>I am trying to figure out if a row is a locked in a table. Can
>somebody give me a pointer?
>
>____________________________
> Pascal Paradis-Th=E9berge
> pascal_at_ia-us.com
Hi Pascal,
try
SELECT 1
FROM your_table
WHERE <condition for the row you want to check>
FOR UPDATE NOWAIT;
If you get an 'ORA-00054 resource busy' the row was already locked in
another session. If not then your're holding the lock now until you
commit or rollback.
HTH
Peter
-- Peter Schneider peter.schneider_at_okay.netReceived on Fri Jan 30 1998 - 00:00:00 CST