DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: PL/SQL ques. - SELECT ... FOR UPDATE

Threaded View

  1. #6
    Join Date
    Jan 2000
    Location
    Chester, England.
    Posts
    818
    Hmmm, need some PL\SQL help here ...

    I DECLARE the EXCEPTION & Cursor:

    resource_busy EXCEPTION;
    PRAGMA EXCEPTION_INIT (resource_busy, -54);

    CURSOR c1 IS
    SELECT ...
    FROM ...
    FOR UPDATE WAIT 30;

    BEGIN
    OPEN c1;
    FETCH c1 etc ...
    UPDATE ...
    SET ...
    WHERE CURRENT OF c1;
    EXCEPTION
    WHEN resource_busy THEN
    RAISE_APPLICATION_ERROR (-20001, ...
    WHEN others THEN
    RAISE_APPLICATION_ERROR (-20002, ...
    END;

    I lock the target record in another session, then run my PL\SQL. It waits 30 seconds then returns with Error -20002 and not - 20001 as expected.

    What am I doing wrong?
    Last edited by JMac; 02-25-2004 at 11:24 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width