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`.`getTicketTrolleyLabelCount`(vTicket INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
RETURNS int(11)
|
|
|
|
NOT DETERMINISTIC
|
|
|
|
READS SQL DATA
|
|
|
|
BEGIN
|
|
|
|
DECLARE vLabelCount INT DEFAULT 0;
|
|
|
|
|
|
|
|
SELECT labelCount INTO vLabelCount
|
|
|
|
FROM ticketTrolley
|
|
|
|
WHERE ticket = vTicket;
|
|
|
|
|
|
|
|
SET vLabelCount = vLabelCount +1 ;
|
|
|
|
|
|
|
|
REPLACE ticketTrolley(ticket,labelCount)
|
|
|
|
SELECT vTicket, vLabelCount;
|
|
|
|
|
|
|
|
RETURN vlabelCount;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|