更新或修改数据的语法:
update / delete .... where current of cursor_name;
前提是游标要先定义for update,否则不能修改数据库中的数据:
例:
修改员工的工资,如果员工的部门号为10,则工资提高1000;如果部门号为20,则工资提高1500;如果部门号为30,则工资提高2000;否则工资提高2500。
declare
cursor c_emp is
select e.deptno, e.salary from employees e for update ;
v_sala