PL SQL program unit will not compile with FOR UPDATE NOWAIT cursor
chriskMar 2 2009 — edited Mar 2 2009All,
I'm trying to use a FOR UPDATE NOWAIT cursor to avoid hung sessions on the front end form.
I'm using syntax like:
CURSOR my_cur (p_val)
IS
SELECT 1
FROM my_table
WHERE my_col = p_val
FOR UPDATE NOWAIT ;
However, later on in the procedure, when I try to reference this cursor with the following syntax:
(after opening/fetching the cursor...)
UPDATE my_table
SET my_col2 = :MY_BLOCK.FOO
WHERE CURRENT OF my_cur;
I get the following compilation error:
Error 404 at line 140, column 30
cursor 'MY_CUR' must be declared with FOR UPDATE to use with CURRENT OF
The peculiar thing is if I remove the "NOWAIT" keyword, the program unit compiles fine.
Has anything else noticed this? Any workaround or fixes? Is this a known bug?
Thanks a lot,
-Chris