I'm new to using events an transactions. What i need is to combine these two sets of code resulting in moving old data to a history table. What is wrong with the code? Tried many different syntaxes but error is: "#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''History' ON SCHEDULE AT TIMESTAMP '2016-10-22 16:00:00' DO START TRA' at line 1"
DELIMITER !!
CREATE EVENT 'History'
ON SCHEDULE AT TIMESTAMP '2016-10-22 16:00:00'
DO
START TRANSACTION;
set @N := (now());
INSERT INTO ss_log_history select * from ss_log where tid < date_sub(@N,INTERVAL 15 DAY);
DELETE FROM ss_log WHERE tid < date_sub(@N,INTERVAL 15 DAY);
COMMIT;
END !!
DELIMITER ;