salix/db/routines/vn/procedures/travel_checkPackaging.sql

31 lines
536 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkPackaging`(vSelf INT)
BEGIN
DECLARE vDone BOOL;
DECLARE vEntryFk INT;
DECLARE cTravelEntries CURSOR FOR
SELECT id
FROM entry
WHERE entry.travelFk = vSelf;
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET vDone = TRUE;
OPEN cTravelEntries;
l: LOOP
SET vDone = FALSE;
FETCH cTravelEntries INTO vEntryFk;
IF vDone THEN
LEAVE l;
END IF;
CALL entry_checkPackaging(vEntryFk);
END LOOP;
CLOSE cTravelEntries;
END$$
DELIMITER ;