22 lines
523 B
MySQL
22 lines
523 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`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 ;
|