create or replace function 函数名称( 传入参数1 in 类型,
传入参数2 in 乐星)
return 返回参数类型 as
定义参数1 参数类型;
定义参数2 参数类型;
begin
--以下为函数中常用的if else格式,注:条件格式:if a=1 then b=1
if 条件1 then
结果1;
elsif 条件2 then
if 条件2.1 then
结果2.1;
else
结果2.2;
end if;
else
结果3;
end if;
--以上为函数中常用的if else格式
return 返回参数;
end 函数名;