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 ;
