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

19 lines
496 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(
2024-08-05 10:26:16 +00:00
vPalletFk INT,
vExpeditionFk INT
)
BEGIN
2024-08-06 10:51:55 +00:00
IF NOT (SELECT TRUE FROM expedition WHERE id = vExpeditionFk LIMIT 1) THEN
2024-08-06 05:27:36 +00:00
CALL util.throw('Expedition not exists');
END IF;
2024-08-05 10:26:16 +00:00
2024-08-06 10:51:55 +00:00
IF NOT (SELECT TRUE FROM expeditionPallet WHERE id = vPalletFk LIMIT 1) THEN
2024-08-06 05:27:36 +00:00
CALL util.throw('Pallet not exists');
2024-08-05 10:26:16 +00:00
END IF;
2024-08-06 05:27:36 +00:00
REPLACE expeditionScan(expeditionFk, palletFk)
VALUES(vExpeditionFk, vPalletFk);
END$$
DELIMITER ;