salix/db/routines/sage/procedures/clean.sql

13 lines
306 B
MySQL
Raw Normal View History

2024-01-25 16:33:54 +00:00
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `sage`.`clean`()
BEGIN
/**
* Maintains tables over time by removing unnecessary data
*/
DECLARE vTwoYearAgo DATE DEFAULT util.VN_CURDATE() - INTERVAL 2 YEAR;
DELETE FROM movConta WHERE FechaAsiento < vTwoYearAgo;
END$$
DELIMITER ;