我已经创建了一个触发器,用于将行从“ tblt_timesheet”复制到“ MYTABLE”,然后从tblt_timesheet中删除行。
复制行有效,但从tblt_timesheet删除行无效。任何帮助将不胜感激。
CREATE TRIGGER MYTRIGGER
AFTER INSERT ON `tblt_timesheet`
FOR EACH ROW BEGIN
IF (NEW.timesheetid IS NOT NULL) THEN
INSERT INTO `MYTABLE` VALUES (NEW.timesheetid,NEW.punchingcode, NEW.date, NEW.time, NEW.Tid);
delete from `tblt_timesheet` where Tid=1;
END IF;
END