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

17 lines
289 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`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 ;