2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`clientGetMana`(vClient INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
RETURNS decimal(10,2)
|
|
|
|
DETERMINISTIC
|
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Devuelve el mana del cliente.
|
|
|
|
*
|
|
|
|
* @param vClient Id del cliente
|
|
|
|
* @return Mana del cliente
|
|
|
|
*/
|
|
|
|
DECLARE vMana DECIMAL(10,2);
|
|
|
|
|
|
|
|
CREATE OR REPLACE TEMPORARY TABLE tmp.client
|
|
|
|
SELECT vClient id;
|
|
|
|
|
|
|
|
CALL client_getMana();
|
|
|
|
|
|
|
|
SET vMana = (SELECT mana
|
|
|
|
FROM tmp.clientMana);
|
|
|
|
|
|
|
|
DROP TEMPORARY TABLE
|
|
|
|
tmp.client,
|
|
|
|
tmp.clientMana;
|
|
|
|
|
|
|
|
RETURN IFNULL(vMana,0);
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|