不能打印漲后工資總額,請幫忙看下
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;
2018-04-23
請問下,這個問題是怎么解決的,我也遇到了這個問題,求指教
2016-06-07
在sql developer上的話要先set serveroutput on,在pl/sql上看輸出
2016-05-31
更換了一下順序,也是打印不出來
2016-05-28
是要先commit 后打印嗎?