salix/db/routines/util/functions/string_checkPrintableAndSpa...

15 lines
418 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`string_checkPrintableAndSpanishChars`(
vString VARCHAR(255)
) RETURNS tinyint(1)
DETERMINISTIC
BEGIN
/**
* Validates whether the input string contains only printable characters
* and Spanish special characters (such as ¡, ÿ, etc.).
*
* @vString string to check
*/
RETURN vString REGEXP '^[ -~¡-ÿ]*$';
END$$
DELIMITER ;