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

15 lines
337 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `dipole`.`clean`()
BEGIN
DECLARE vFromDated DATE;
SET vFromDated = TIMESTAMPADD(WEEK, -2, util.VN_CURDATE());
DELETE FROM dipole.expedition_PrintOut
WHERE created < vFromDated;
DELETE FROM dipole.expedition_Read
WHERE created < vFromDated;
END$$
DELIMITER ;