can an update operation not been hooked if record has beed locked?
Date: 30 Apr 2002 06:20:12 -0700
Message-ID: <f76a630f.0204300520.59c7ecf2_at_posting.google.com>
Hello, all
I found that there is nowait option for "select for update", "lock table",
I would like to know if there is nowait option for update? Or is there a nowait
option for a tranacation?
also I found a pl/sql script from The Oracle (tm) Users' Co-Operative FAQ
to identify all locked rows in a table. I would like to know what does the
_at_nowait and nowait_cond mean. Sorry I know little about pl/sql and I just
check the document in a hurry and find no clue. The script is below:
UT1> set echo on
UT1> _at_nowait
UT1> set serveroutput on
UT1> declare
2 v_rowid rowid ;
3 v_fld1 marktest.fld1%type;
4 v_fld1b marktest.fld1%type;
5 --
6 cursor c_fulltable is
7 select rowid
8 ,fld1
9 from marktest
10 order by fld2;
11 --
12 nowait_cond exception ;
13 pragma exception_init(nowait_cond,-00054) ;
14 --
15 begin
16 open c_fulltable;
17 loop
18 fetch c_fulltable into v_rowid, v_fld1;
19 exit when c_fulltable%notfound;
20 begin
21 select fld1
22 into v_fld1b
23 from marktest a
24 where a.rowid = v_rowid
25 for update nowait;
26 dbms_output.put_line('Got row '||v_fld1);
27 exception
28 when nowait_cond then
29 dbms_output.put_line('Row is locked '||v_fld1);
30 end;
31 end loop;
32 close c_fulltable;
33 end;
34 /
Row is locked one
Got row two
Row is locked three
Got row four
Row is locked five
Anyone know about it? Many thanks!
PanTao
Received on Tue Apr 30 2002 - 15:20:12 CEST