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

31 lines
527 B
MySQL
Raw Normal View History

DELIMITER $$
2024-11-28 07:13:53 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`entry_clone`(
vSelf INT,
OUT newEntryFk INT
)
BEGIN
/**
* clones an entry.
*
* @param vSelf The entry id
2024-11-28 07:13:53 +00:00
* @param newEntryFk Output parameter of the new created input
*/
DECLARE vNewEntryFk INT;
2024-05-23 10:39:30 +00:00
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
RESIGNAL;
END;
START TRANSACTION;
CALL entry_cloneHeader(vSelf, vNewEntryFk, NULL);
CALL entry_copyBuys(vSelf, vNewEntryFk);
COMMIT;
2024-07-11 07:39:06 +00:00
SET newEntryFk = vNewEntryFk;
END$$
DELIMITER ;