salix/db/routines/vn/functions/getUserId.sql

17 lines
287 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`getUserId`(userName varchar(30))
RETURNS int(11)
NOT DETERMINISTIC
READS SQL DATA
BEGIN
DECLARE vUser INT;
SELECT id INTO vUser
FROM account.user
WHERE `name` = userName;
RETURN vUser;
END$$
DELIMITER ;