如何使用存储函数mysql
drop function if exists finger_name;
DELIMITER \\
CREATE DEFINER=`root`@`localhost` FUNCTION `finger_name`(finger_id INT)
RETURNS `VARCHAR`(45) CHARSET `utf8`
BEGIN
DECLARE NAME `varchar`(45);
CASE finger_id
WHEN 1 THEN
SET NAME= `Right Thumb`;
WHEN 2 THEN
SET NAME= `Right Index`;
WHEN 3 THEN
SET NAME= `Right Middle`;
ELSE
SET NAME= `Not Registered`;
END CASE;
RETURN NAME;
END\\
delimiter ;
SELECT FINGER_NAME(2);
错误代码:1054 '字段列表中的未知列'右索引'