DELIMITER $$
CREATE TRIGGER DELETETRIGGER AFTER DELETE ON WORKLOG
FOR EACH ROW
BEGIN
INSERT INTO WORKLOGCOPY (Log_ID, Order_ID, Employee_ID, Client_ID,
Work_Completed, Hours_Taken, Date_Logged)
VALUES(OLD.Log_ID, OLD.Order_ID, OLD.Employee_ID, OLD.Client_ID,
OLD.Work_Completed, OLD.Hours_Taken, OLD.Date_Logged)
END$$
DELIMITER ;
我得到一个错误:
# 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
'END' at line 6
我试过在语法上乱来,以匹配我见过的例子,但没有运气。
在phpmyadmin上使用mysql如果有帮助的话。
谢谢您。
1条答案
按热度按时间ijnw1ujt1#
你失踪了
;
结束时INSERT INTO
```DELIMITER $$
CREATE TRIGGER DELETETRIGGER AFTER DELETE ON WORKLOG
FOR EACH ROW
BEGIN
INSERT INTO WORKLOGCOPY (Log_ID, Order_ID, Employee_ID, Client_ID,
Work_Completed, Hours_Taken, Date_Logged)
VALUES(OLD.Log_ID, OLD.Order_ID, OLD.Employee_ID, OLD.Client_ID,
OLD.Work_Completed, OLD.Hours_Taken, OLD.Date_Logged);
END$$
DELIMITER ;