2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-03-15 13:46:43 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_copyBuys`(vSelf INT, vDestinationEntryFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
2024-03-15 13:46:43 +00:00
|
|
|
* Copies all buys from an entry to an entry.
|
2024-01-15 11:31:03 +00:00
|
|
|
*
|
|
|
|
* @param vSelf The entry id
|
2024-03-15 13:46:43 +00:00
|
|
|
* @param vDestinationEntryFk The destination entry id
|
2024-01-15 11:31:03 +00:00
|
|
|
*/
|
2024-03-15 13:46:43 +00:00
|
|
|
CREATE OR REPLACE TEMPORARY TABLE tmp.buy
|
|
|
|
SELECT id
|
2024-01-15 11:31:03 +00:00
|
|
|
FROM buy
|
|
|
|
WHERE entryFk = vSelf;
|
2024-03-15 13:46:43 +00:00
|
|
|
|
|
|
|
CALL buy_clone(vDestinationEntryFk);
|
|
|
|
DROP TEMPORARY TABLE tmp.buy;
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|