[转] Oracle函数取得姓名对应的拼音

 
/*取得姓名对应的拼音*/

CREATE OR REPLACE FUNCTION F_GET_PY (V_XM varchar) RETURN VARCHAR2 IS
s_py varchar2(100);
z_hz varchar2(2);
z_py varchar2(10);
i number(3);
i_jls number(5);
BEGIN
s_py:='';
if v_xm is not null then
for i in 1..length(v_xm) loop
z_hz := substr(v_xm,i,1);
select count(*) into i_jls from t_dm_szm where hz=z_hz;
if i_jls >0 then
select py into z_py from t_dm_szm where hz=z_hz;
if i = 1 then
s_py:=s_py||z_py;
else
s_py:=s_py||z_py;
end if;
end if;
if z_hz='·' then
exit;
end if;
end loop;
end if;

RETURN s_py;
END;
 
来源: http://blog.csdn.net/zhangbo936/archive/2011/05/09/6406395.aspx
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值