您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
oracle-存储过程与存储函数
发布时间:2017-11-23 15:04:29编辑:雪饮阅读()
存储过程的创建与调用:
SQL> create procedure p08
2 is
3 begin
4 dbms_output.put_line('hello');
5 end;
6 /
Procedure created.
SQL> call p08();
hello
Call completed.
带参存储过程的创建与调用:
SQL> create procedure p09(width int,height int)
2 is
3 area int :=0;
4 begin
5 area:=width*height;
6 dbms_output.put_line('area is '||area);
7 end;
8 /
Procedure created.
SQL> call p09(5,6);
area is 30
Call completed.
函数的创建与调用:
SQL> create or replace function mysum(a int,b int) return int
2 is
3 total int :=0;
4 begin
5 total :=a+b;
6 return total;
7 end;
8 /
Function created.
SQL> select mysum(3,4) from dual;
MYSUM(3,4)
----------
7
关键字词:oracle-存储过程,函数
上一篇:oracle-触发器
下一篇:oracle-递归函数