This question already has an answer here:
- MYSQL Trigger not working 1 answer
Here's the create statement pulled out of the database itself for a trigger:
CREATE DEFINER=`walkdot_logan`@`18.104.22.168` TRIGGER `wd_artists_bi_trg` BEFORE INSERT ON `wd_artists` FOR EACH ROW BEGIN IF NEW.modified_on is null THEN INSERT INTO wd_modified_records (modified_date, table_name, record_identifiers) SELECT SYSDATE(), 'artists', CONCAT('code:', NEW.code, ';'); SET NEW.modified_on = SYSDATE(); END IF; END;
Both HeidiSQL and MySQL Workbench are complaining about syntax errors; saying that the semi-colon is missing from the
SELECT statement line. MySQL Workbench is even underscoring the closing parenthesis to tell me I'm missing the semi-colon.
EDIT: I should point out that I've tried several insert types, and even simple select statements and the semi-colon error persists. Also, I was able to make this trigger using the trigger creator form in HeidiSQL without incident.