函数
- 函数
有返回值的子程序 return
语法
create [or replace] function 函数名字(变量名1,变量类型1,...)
return 返回类型
as
--定义变量
...
begin
--执行的代码
...
return 返回值;
exception when 异常类型 then 异常处理;
end
调用
[declare
变量1 数据类型1;
...
]
begin
函数名(值1,...);
end
- 函数的其他特征
删除函数
drop function 函数名;
删除过程
drop Procedure 过程名;
授予其他用户执行子程序的权限
grant execute on 子程序名 to 用户名;