要求是这样的:
1.以Scott用户登录
2.修改EMP表下的SAL:先将SAL从小到大的排序起来,然后从第一个人开始加工资,增加幅度为10%,增加的工资总额不超过50万。
(也就是说有50万给你加工资,从最少的开始加,当50万用完了,后边即使还有人没有被加上也不管了)set serveroutput on
declare
sal1  NUMBER(7,2);
sal2  NUMBER(7,2);
sal3  NUMBER(7,2);
 NUMBER(7,2):=0;
cursor x is 
select sal from emp 
order by sal;
begin
open x;
 loop
exit when >500000; 
fetch x into sal1;
sal3:=sal1;
sal2:=sal1+sal1*0.1;
update emp set sal=sal2 where sal=sal3;
:=+sal1;
end loop;
dbms_output.put_line();
close x;
end;
/在SQL*PLUS运行后总是变得程序无法响应
我的经验少,请大家指点指点吧