日期:2014-05-17 浏览次数:20822 次
create or replace procedure lee_update_sala as cursor c_row is select * from lee_emp_0714 for update of sala; begin for v_row in c_row loop if v_row.sala=2459 then sala:=sala+1000; end loop; end;
update lee_emp_0714 set sala=sala+1000 where sala=2459;
------解决方案--------------------
错误很多。 修改如下: create or replace procedure lee_update_sala as cursor c_row is select * from lee_emp_0714 where sala=2459 for update of sala; begin for v_row in c_row loop update lee_emp_0714 set sala=sala+1000 where current of c_row; end loop; commit; end; /