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

19 lines
490 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
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
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);
END$$
DELIMITER ;