mocha/sql/mysql/000-functions/mocha_normalize_uuid.sql

10 lines
229 B
SQL

DROP FUNCTION IF EXISTS mocha_normalize_uuid;
CREATE FUNCTION mocha_normalize_uuid(p_uuid CHAR(40))
RETURNS CHAR(32) NO SQL
DETERMINISTIC
BEGIN
RETURN LOWER(REPLACE(REPLACE(REPLACE(p_uuid, '{', ''), '}', ''), '-', ''));
END