13 lines
306 B
MySQL
13 lines
306 B
MySQL
|
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 ;
|