首页 > 数据库技术 > 详细

Oracle函数

时间:2016-09-20 21:22:35      阅读:259      评论:0      收藏:0      [点我收藏+]

--函数 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函数

原文:http://www.cnblogs.com/liu-chao-feng/p/5890365.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!