DB2中一个全角到半角的转换函数
2007-12-11 20:47
225 查看
create function conv(input varchar(100))
returns varchar(100)
begin atomic
declare i integer;
declare code integer;
declare str varchar(100);
set i=1;
set str='';
while i<length(input) do
set code=ascii(substr(input,i,1));
if(code=163) then
set str=str||chr(ascii(substr(input,i+1,1))-128);
set i=i+2;
else
set str=str||substr(input,i,1);
set i=i+1;
end if;
end while;
return str;
end@
returns varchar(100)
begin atomic
declare i integer;
declare code integer;
declare str varchar(100);
set i=1;
set str='';
while i<length(input) do
set code=ascii(substr(input,i,1));
if(code=163) then
set str=str||chr(ascii(substr(input,i+1,1))-128);
set i=i+2;
else
set str=str||substr(input,i,1);
set i=i+1;
end if;
end while;
return str;
end@
相关文章推荐
- 半角与全角之间转换函数(字母、数字)
- oracle 全角半角转换函数
- C#全角半角相互转换函数
- 全角和半角的转换函数
- C#全角半角转换函数
- oracle 全角半角转换函数
- JS视半角全角均为一个字符,用prototype解决之
- 全角半角转换函数
- 半角和全角转换函数
- oracle 全角半角转换函数.
- PHP全角半角转换函数
- C#全角半角转换函数
- c# 全角(SBC)和半角(DBC)相互转换函数
- C#全角半角转换函数
- PHP 全角和半角转换函数
- java 全角半角转换函数
- C# 全角/半角转换函数
- 全角半角转换函数
- PHP全角半角转换函数
- 将一个字串中含有全角的数字字符、字母、空格或'%+-()'字符转换为相应半角字符