|
create or replace function zen2han (zen_str in varchar2) return varchar2 as
han_str varchar2(32767);
begin
han_str := zen_str;
if instrb(han_str,'゚') > 0 or instrb(han_str,'゙') > 0 then
han_str := replace(han_str,'ガ','ガ');
han_str := replace(han_str,'ギ','ギ');
han_str := replace(han_str,'グ','グ');
han_str := replace(han_str,'ゲ','ゲ');
han_str := replace(han_str,'ゴ','ゴ');
han_str := replace(han_str,'ザ','ザ');
han_str := replace(han_str,'ジ','ジ');
han_str := replace(han_str,'ズ','ズ');
han_str := replace(han_str,'ゼ','ゼ');
han_str := replace(han_str,'ゾ','ゾ');
han_str := replace(han_str,'ダ','ダ');
han_str := replace(han_str,'ヂ','ヂ');
han_str := replace(han_str,'ヅ','ヅ');
han_str := replace(han_str,'デ','デ');
han_str := replace(han_str,'ド','ド');
han_str := replace(han_str,'バ','バ');
han_str := replace(han_str,'ビ','ビ');
han_str := replace(han_str,'ブ','ブ');
han_str := replace(han_str,'ベ','ベ');
han_str := replace(han_str,'ボ','ボ')
;
han_str := replace(han_str,'パ','パ');
han_str := replace(han_str,'ピ','ピ');
han_str := replace(han_str,'プ','プ');
han_str := replace(han_str,'ペ','ペ');
han_str := replace(han_str,'ポ','ポ')
;
end if;
return translate(han_str,
'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッー',
'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッー');
end zen2han;
|