salix/db/routines/srt/functions/buffer_getState.sql

24 lines
470 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `srt`.`buffer_getState`(vSelf INT)
RETURNS varchar(20) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci
NOT DETERMINISTIC
READS SQL DATA
BEGIN
/**
* Devuelve una cadena con el estado del buffer
*
*/
DECLARE vState VARCHAR(20);
SELECT bs.description INTO vState
FROM srt.buffer b
JOIN srt.bufferState bs ON bs.id = b.stateFk
WHERE b.id = vSelf;
RETURN vState;
END$$
DELIMITER ;