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

19 lines
498 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-05 10:26:16 +00:00
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(
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 ;