当前位置:Gxlcms > 数据库问题 > Oracle函数

Oracle函数

时间:2021-07-01 10:21:17 帮助过:5人阅读

--函数 function
create or replace function fn_teacher_tid
(
f_tid char --用户传递的参数
)
return char --返回值的类型
is --声明返回值
f_result teacher.tid%type;
begin
if length(f_tid)!=18 then
dbms_output.put_line(‘身份证长度不够!‘);
else
dbms_output.put_line(‘查询成功!‘);
end if;
--给返回值赋值
f_result:=substr(f_tid,1,6)||‘********‘||substr(f_tid,15);
return f_result;
end fn_teacher_tid;

--调用函数
select fn_teacher_tid(372925201507190224) from dual

 

Oracle函数

标签:

人气教程排行