不能打印涨后工资总额,请帮忙看下
declare
cursor c1 is select empno,sal from emp1 order by sal;
pempno emp1.empno%type;
psal emp1.sal%type;
totalsal number;
totalemp number :=0;
begin
select sum(sal) into totalsal from emp1;
open c1;
loop
exit when totalsal>50000;
fetch c1 into pempno,psal;
exit when c1%notfound;
update emp1 set sal=sal*1.1 where empno=pempno;
totalemp :=totalemp+1;
totalsal :=totalsal + psal*0.1;
end loop;
close c1;
dbms_output.put_line(totalsal);
dbms_output.put_line(totalemp);
commit;
end;