Skip to content

Instantly share code, notes, and snippets.

@eight
Created November 21, 2009 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eight/240025 to your computer and use it in GitHub Desktop.
Save eight/240025 to your computer and use it in GitHub Desktop.
CREATE OR REPLACE FUNCTION hanzen(str in VARCHAR2) RETURN VARCHAR2
/*
全角のアルファベット、数字を半角にして、半角カナを全角にして、他の記号もいい感じにする
*/
IS
tmp varchar2(2000);
BEGIN
tmp := alnum2han(han2zen(str));
tmp := translate(
tmp,
'|=+-/@!”’#$%&;: ',
'|=+-/@!"''#$%&;: '
);
RETURN tmp;
END hanzen;
/
SELECT hanzen(' ィァァィ<><>;:”()=!%$#’アイウエオカ|=+-/@!”’#$%&();:[]【】〔〕<>¥^キクケコザズゾざずぞザズダド1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') FROM dual;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment