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;
请问下,这个问题是怎么解决的,我也遇到了这个问题,求指教
在sql developer上的话要先set serveroutput on,在pl/sql上看输出
更换了一下顺序,也是打印不出来
是要先commit 后打印吗?