as
vsal emp.sal%type;
cursor c_get_sal is select * from emp for update;
Begin
open c_get_sal;
fetch c_get_sal.sal into vsal;
while c_get_sal%found loop
case
when vsal>5000 then
update emp set falg='high' where current of c_get_sal;
when vsal>=3000 and vasl<=5000
update emp set flag='middle' where current of c_get_sal;
else
update emp set flag='low' where current of c_get_sal;
end case;
fetch c_get_sal.sal into vsal;
end loop;
close c_get_sal;
commit;
exception when others then
dbms_output.put_line('couwu');
rollback;
end;
PROCEDURE QRY.EMP_COMM 编译错误
错误:PLS-00103: Encountered the symbol "UPDATE" when expecting one of the following:
* & - + / at mod remainder rem then
|| multiset
The symbol "then" was substituted for "UPDATE" to continue.
行:14
文本:update emp set flag='middle' where current of c_get_sal;