[英]Mysql trigger syntax error 1064
I have a very large file that creates triggers that I auto generated.我有一个非常大的文件,它创建了我自动生成的触发器。 However I'm not able to get passed line 3.
但是我无法通过第 3 行。
Php version 5.3.2 Mysql Version 14.14 Distrib 5.1.41 Php 版本 5.3.2 Mysql 版本 14.14 发行版 5.1.41
Here are the first few lines:这是前几行:
1 delimiter $$
2 -- CompanyTitleHolder
3 -- Create INSERT event for CompanyTitleHolder
4 CREATE OR REPLACE TRIGGER trigger_insert_CompanyTitleHolder AFTER INSERT ON CompanyTitleHolder
5 FOR EACH ROW
6 BEGIN
7
8 IF(NEW.CompanyTitleHolderID <> '') OR (NEW.CompanyTitleHolderID IS NOT NULL) THEN
9 CALL add_Audit (@UserName, "CompanyTitleHolder", "CompanyTitleHolderID", "--new record--", NEW.CompanyTitleHolderID);
10 END IF;
11 -- This goes on for quite a while
?? END;$$
?? delimiter ;
And this is the error:这是错误:
/* SQL Error (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 'TRIGGER trigger_insert_CompanyTitleHolder AFTER INSERT ON CompanyTitleHolder F' at line 3 */
I'm trying to do an audit table using this method and code as my base我正在尝试使用这种方法和代码作为我的基础来做一个审计表
MySQL doesn't support OR REPLACE
: http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html MySQL doesn't support
OR REPLACE
: http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html
You can't CREATE OR REPLACE
.你不能
CREATE OR REPLACE
。
Try:尝试:
DROP TRIGGER IF EXISTS trigger_insert_CompanyTitleHolder;
CREATE TRIGGER trigger_insert_CompanyTitleHolder AFTER INSERT ON CompanyTitleHolder
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.