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 ;