salix/db/routines/hedera/procedures/myTicket_logAccess.sql

16 lines
393 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `hedera`.`myTicket_logAccess`(vSelf INT)
BEGIN
/**
* Logs an access to a ticket.
*
* @param vSelf The ticket identifier
*/
INSERT INTO vn.ticketLog
(originFk, userFk, `action`, description)
SELECT vSelf, account.myUser_getId(), 'select', 'Accede a ticket'
FROM myTicket t
WHERE t.id = vSelf;
END$$
DELIMITER ;