2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:07:33 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(
|
2024-08-05 10:26:16 +00:00
|
|
|
vPalletFk INT,
|
|
|
|
vExpeditionFk INT
|
|
|
|
)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
2024-11-22 08:10:18 +00:00
|
|
|
IF NOT EXISTS (SELECT id FROM expeditionPallet WHERE id = vPalletFk) THEN
|
|
|
|
CALL util.throw('Pallet not exists');
|
2024-08-06 05:27:36 +00:00
|
|
|
END IF;
|
2024-08-05 10:26:16 +00:00
|
|
|
|
2024-11-22 08:10:18 +00:00
|
|
|
IF NOT EXISTS (SELECT id FROM expedition WHERE id = vExpeditionFk) THEN
|
|
|
|
CALL util.throw('Expedition 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);
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|