Eliminate Korean MySql function

CREATE DEFINER=`cosmos`@`%` FUNCTION `onlyHanja`(`iName` text )

RETURNS varchar(4000) CHARSET utf8

LANGUAGE SQL

NOT DETERMINISTIC

CONTAINS SQL

SQL SECURITY DEFINER

COMMENT

BEGIN

declare iChar varchar(1);

declare oName text;

declare i INT DEFAULT 1;

SET oName = iName;

WHILE i <= length(iName) DO

SET iChar = SUBSTRING(iName,i,1) ;

IF iChar between ‘가’ and ‘힣’ THEN

SET oName = replace(oName,iChar,) ;

END IF ;

SET i = i + 1;

END WHILE;

SET oName = replace(oName,‘(‘,);

SET oName = replace(oName,‘)’,);

RETURN (oName);

END

Leave a Reply

Your email address will not be published. Required fields are marked *