Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: selecting non-locked rows

Re: selecting non-locked rows

From: <xmark.powell_at_eds.com.x>
Date: 30 Mar 2001 14:41:33 GMT
Message-ID: <9a25ut$n0o$1@news.netmar.com>

In article <9a20ph$3ci63$1_at_ID-37725.news.dfncis.de>, steno <snovotny_at_integro.net> writes:
>hi there,
>
>i'm searching for a way to select all rows that are not locked by another
>session/select for update.
>anyone knows how i can do that?
>
>thanx in advance
>steno
>

You can add the nowait parameter to a select for update in version 8+. I can not remember when this was added to sql; it existed in pl/sql before if was added to regular sql. However, from the manual if appears the sql statement is cancelled if a locked row is encountered so it would appear you would need to use a cursor in pl/sql to process the rows:

cursor to select rows
loop
fetch row in cursor
perform select for update nowait on cursor row if returned process
else nowait condition detected skip
end if
end loop

Received on Fri Mar 30 2001 - 08:41:33 CST

Original text of this message

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