salix/db/routines/vn/procedures/expeditionState_addByExpedi...

19 lines
525 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`expeditionState_addByExpedition`(vExpeditionFk INT, vStateCode VARCHAR(100))
BEGIN
/**
* Inserta nuevos registros en la tabla vn.expeditionState
*
* @param vExpeditionFk Identificador de vn.expedition
* @param vStateCode Corresponde a vn.expeditionStateType.code
*/
INSERT INTO vn.expeditionState(expeditionFk, typeFk)
SELECT vExpeditionFk, est.id
FROM vn.expeditionStateType est
WHERE est.code = vStateCode;
END$$
DELIMITER ;