改良一下Loop,对调
loop
--取一个员工
fetch cemp into pempno,psal;
--2.notfound涨完
exit when cemp%notfound;
--1. 总额>5w
exit when (salTotal + psal *0.1) >= 50000;
update emp set sal=sal*1.1 where empno=pempno;
--人数+1
countEmp := countEmp +1;
--2. 涨后=涨前+sal*0.1
salTotal := salTotal + psal *0.1;
end loop;