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

11 lines
363 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`getInfoDelivery`(vRouteFk INT)
BEGIN
SELECT s.name, s.street, s.city, s.nif, s.postCode FROM vn.route r
JOIN vn.agencyMode am ON r.agencyModeFk = am.id
JOIN vn.agency a ON am.agencyFk = a.id
JOIN vn.supplier s ON a.supplierFk = s.id
WHERE r.id = vRouteFk;
END$$
DELIMITER ;