Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: selecting non-locked rows
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
![]() |
![]() |