|
|
我做了个测试:
create or replace procedure test as
cursor cur_test_po is
select ph.po_no,pla.item from po_headers ph,po_lines_all pla
where ph.po_no = pla.po_no for update of pla.item;
v_cur_test_po cur_test_po%rowtype;
begin
for v_cur_test_po in cur_test_po loop
update po_lines_all t set t.item = t.item || ' '
where current of cur_test_po;
commit;
end loop;
end;
在上述循环中,只能更新po_lines_all表。因为:for update of pla.item;
错误信息:无效的Rowid;
在上述循环中,更新po_lines_all表时,po_lines_all表中的行被锁定。在另外的窗口中更新,错误如下:Record is locked by another user;此时可在其它的新窗口中更新po_hearder。
(测试在PL/SQL Developer中进行,Oracle 9.*.***) |
|