您好,欢迎光临本网站![请登录][注册会员]  
文件名称: Oracle 汉字转全拼 拼音首字母
  所属分类: Oracle
  开发工具:
  文件大小: 38kb
  下载次数: 1
  上传时间: 2011-04-24
  提 供 者: chenb*****
 详细说明: --此函数默认返回汉字拼音的首字母,第二个参数不为空则返回全拼。 create or replace function f_getFirstOrFullSpell(p_cnStr In varchar2,p_sign In number default null) return varchar2 as lv_spell varchar2(200); lv_temp Varchar2(10); lv_char varchar2(10); --lv_bytes varchar2(100); li_bytes Integer; --li_pos Integer; begin if p_cnStr is null then return ''; end if; for i In 1..length(p_cnStr) loop lv_char:=substr(p_cnStr,i,1); if lengthb(lv_char) = 1 then lv_spell:=lv_spell||lv_char; elsif lengthb(lv_char) = 2 then --Select replace(substrb(dump(lv_char,1010),instrb(dump(lv_char,1010),'ZHS16GBK:')),'ZHS16GBK: ','') Into lv_bytes from dual; --li_pos:=instr(lv_bytes,','); --li_bytes:=substr(lv_bytes,1,li_pos-1)*256+substr(lv_bytes,li_pos+1)-256*256; Select ascii(lv_char)-256*256 Into li_bytes From dual; select max(spell) Into lv_temp from table(f_getSpellcode) where code<=li_bytes; if p_sign is null then lv_spell:=lv_spell||substr(lv_temp,1,1); else lv_spell:=lv_spell||lv_temp; end if; elsif lengthb(lv_char) = 3 then --Select replace(substrb(dump(convert(lv_char,'ZHS16GBK','UTF8'),1010),instrb(dump(convert(lv_char,'ZHS16GBK','UTF8'),1010),'UTF8:')),'UTF8: ','') --Into lv_bytes from dual; --li_pos:=instr(lv_bytes,','); --li_bytes:=substr(lv_bytes,1,li_pos-1)*256+substr(lv_bytes,li_pos+1)-256*256; Select ascii(lv_char)-256*256 Into li_bytes From dual; select max(spell) Into lv_temp from table(f_getSpellcode) where code<=li_bytes; if p_sign is null then lv_spell:=lv_spell||substr(lv_char,1,1); else lv_spell:=lv_spell||lv_char; end if; end if; end loop; return lv_spell; end; --hanjs,07-10-24,此函数默认返回汉字拼音的首字母,第二个参数不为空则返回全拼。 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 输入关键字,在本站1000多万海量源码库中尽情搜索: