I have very long SQL file which includes $variable in format like:
DELIMITER $$
DROP TRIGGER IF EXISTS `$variable` $$
CREATE TRIGGER `TEMP` BEFORE INSERT ON `5_2012`
FOR EACH ROW BEGIN
set NEW.chour = timediff(NEW.exit, NEW.enter);
set NEW.total = timediff(NEW.exit, NEW.enter);
...
I need a way to execute this script each time with different table names ($variable).
I am using MySQL.