2020-03-09 08:00:03 +00:00
|
|
|
DROP FUNCTION IF EXISTS account.user_getNameFromId;
|
|
|
|
|
|
|
|
DELIMITER $$
|
|
|
|
CREATE DEFINER=`root`@`%` FUNCTION `account`.`user_getNameFromId`(vSelf INT) RETURNS varchar(30) CHARSET utf8
|
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Gets user name from it's id.
|
|
|
|
*
|
|
|
|
* @param vSelf The user id
|
|
|
|
* @return The user name
|
|
|
|
*/
|
|
|
|
DECLARE vName VARCHAR(30);
|
|
|
|
|
|
|
|
SELECT `name` INTO vName
|
|
|
|
FROM user
|
2020-09-28 19:25:53 +00:00
|
|
|
WHERE id = vSelf;
|
2020-03-09 08:00:03 +00:00
|
|
|
|
2020-09-28 19:25:53 +00:00
|
|
|
RETURN vName;
|
2020-03-09 08:00:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|