I'm trying to see, how UPDATE Lock helps to minimize error while dml (delete/update) operations.
declare
cursor update_lock is select empno from emp where deptno=&no for update of sal;
num number;
begin
--for i in update_lock loop
--end loop;
open update_lock;
loop
fetch update_lock into num;
exit when update_lock%notfound;
dbms_output.put_line(num);
end loop;
update emp set sal=sal+10 where current of update_lock;
close update_lock;
end;
I'm using very simple code to check, how does it works. But, it showing Invalid ROWID. Can anyone help me?