MySQL Forums
Forum List  »  Triggers

Syntax error on creating trigger
Posted by: Danon Knox
Date: January 26, 2018 05:01PM

I am trying to create a trigger on a table called "wx4rb_core_log_searches". I want to take the value of the column 'search_term' after an insert and insert that value into the table wx4rb_k2_tags in the column 'name'. The table wx4rb_k2_tags has another column called 'published' which must be set to one for each insert. Having said all that this was my trigger definition:

CREATE TRIGGER updateK2TagCloud AFTER INSERT
ORDER 1 ON wx4rb_core_log_searches
FOR EACH ROW

BEGIN

insert into wx4rb_k2_tags (name,published) values (NEW.search_term,1);


END

I keep getting an error on the line that says:
insert into wx4rb_k2_tags (name,published) values (NEW.search_term,1);
The error is unexpected token. What's wrong with my syntax??

Options: ReplyQuote


Subject
Views
Written By
Posted
Syntax error on creating trigger
1492
January 26, 2018 05:01PM
2092
January 26, 2018 06:09PM
1004
January 26, 2018 06:09PM
687
January 26, 2018 08:36PM
671
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.