SQL> conn scott/tiger
已连接。
SQL> declare
2 v_dept number;
3 begin
4 select deptno
5 into v_dept
6 from emp
7 where job='PRESIDENT';
8 update_commission(v_dept);
9 end;
10 /
PL/SQL 过程已成功完成。
SQL> select sal,comm from emp where deptno=10;
SAL COMM
---------- ----------
2450 24500
5000 50000
1300 13000
declare
v_dept number;
begin
select deptno
into v_dept
from emp
where job='PRESIDENT';
update_commission(v_dept);
end;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/77164/viewspace-1008290/ ,如需转载,请注明出处,否则将追究法律责任。