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

21 lines
355 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_clone`(vSelf INT)
BEGIN
/**
* clones an entry.
*
* @param vSelf The entry id
*/
DECLARE vNewEntryFk INT;
START TRANSACTION;
CALL entry_cloneHeader(vSelf, vNewEntryFk, NULL);
CALL entry_copyBuys(vSelf, vNewEntryFk);
COMMIT;
SELECT vNewEntryFk;
END$$
DELIMITER ;