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

22 lines
521 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`entry_cloneWithoutBuy`(vSelf INT, OUT vNewEntryFk INT)
BEGIN
/**
* Clona una entrada sin compras
*
* @param vSelf Identificador de vn.entry
* @param vNewEntryFk Identificador de la nueva entrada
*/
START TRANSACTION;
CALL entry_cloneHeader(vSelf, vNewEntryFk, NULL);
UPDATE entry d JOIN entry s ON s.id = vSelf
SET d.`reference` = s.`reference`,
d.loadPriority = s.loadPriority
WHERE d.id = vNewEntryFk;
COMMIT;
END$$
DELIMITER ;