MySQL Forums
Forum List  »  Triggers

Re: Syntax error on creating trigger
Posted by: Danon Knox
Date: January 26, 2018 06:09PM

I changed it to this:

DELIMITER #

CREATE TRIGGER updateK2TagCloud AFTER INSERT ON wx4rb_core_log_searches
FOR EACH ROW
BEGIN
insert into wx4rb_k2_tags (name,published) values (NEW.search_term,1)
END#

DELIMITER ;

And this is the error I got:
Error

SQL query:

CREATE TRIGGER updateK2TagCloud AFTER INSERT ON wx4rb_core_log_searches
FOR EACH ROW
BEGIN
insert into wx4rb_k2_tags (name,published) values (NEW.search_term,1)
END
DELIMITER ;

MySQL said: Documentation
#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
DELIMITER' at line 5

This is my version info:
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.7.20-0ubuntu0.16.04.1-log - (Ubuntu)
Protocol version: 10

Options: ReplyQuote


Subject
Views
Written By
Posted
1526
January 26, 2018 05:01PM
Re: Syntax error on creating trigger
2123
January 26, 2018 06:09PM
1019
January 26, 2018 06:09PM
701
January 26, 2018 08:36PM
687
January 26, 2018 08:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.