ITPub博客

首页 > 数据库 > Oracle > 4 execute procedure (在另一个命名程序块或匿名程序块中执行这个程序,那么就不需要EXECUTE关进字。)

4 execute procedure (在另一个命名程序块或匿名程序块中执行这个程序,那么就不需要EXECUTE关进字。)

原创 Oracle 作者:qinglory 时间:2008-08-01 15:44:04 0 删除 编辑
在另一个命名程序块或匿名程序块中执行这个程序,那么就不需要EXECUTE关进字。

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;

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/77164/viewspace-1008290/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 5 plsql 控制结构
请登录后发表评论 登录
全部评论

注册时间:2008-08-01

  • 博文量
    23
  • 访问量
    116106