存储过程
PROCEDURE [schema.]name[( parameter[, parameter...] ) ] [AUTHID DEFINER | CURRENT_USER ] [ACCESSIBLE BY (program_unit_list)] IS [declarations] BEGIN executable statements [ EXCEPTION exception handlers] END [name];
--Authid 语句:定义者权限模型和调用者权限模型
函数
FUNCTION [schema.]name[( parameter[, parameter...] ) ] RETURN return_datatype [AUTHID DEFINER | CURRENT_USER] [DETERMINISTIC] [PARALLEL_ENABLE ...] [PIPELINED] [RESULT_CACHE ...] [ACCESSIBLE BY (program_unit_list) [AGGREGATE ...] [EXTERNAL ...] IS [declaration statements] BEGIN executable statements [EXCEPTION exception handler statements] END [name];
--DETERMINISTIC 语句: 函数的返回值完全由 argument values 决定
--PIPELINED 语句: 表函数的结果将通过PIPE ROW命令迭代返回
--AGGREGATE 语句:自定义聚合函数时使用
--EXTERNAL 语句:该函数将通过外部代码实现,如C语言代码
参数