Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Lock timeout on oracle 8i
Regardless what others day, I think you have a legitimate requirement
and the code looks OK (I didn't try). What's your question then? Did
you try? Does it work?
Yong Huang
rsusanto_at_atlas-sp.com (Rudy Susanto) wrote in message news:<1a928d0b.0205232010.45b85f49_at_posting.google.com>...
> declare
> i number(3,0);
> v_ename varchar2(10);
>
> busy exception;
> pragma exception_init(busy,-54);
>
> begin
> i := 1;
> loop
> begin
> select ename into v_ename
> from emp
> where empno=7900 for update nowait;
> dbms_output.put_line('ename: ' || v_ename);
>
> exception
> when busy then
> if i < 3 then
> dbms_lock.sleep(0.5);
> else
> dbms_output.put_line('Locking record(s) failed ...');
> exit;
> end if;
> end;
>
> i := i + 1;
> end loop;
> end;
Received on Fri May 24 2002 - 23:03:42 CDT