I am using phpmyadmin and got a syntax error from my trigger part. I followed examples online but didn't see anything wrong. Does anyone see the syntax error? Thank you in advance.
Here is my code:
CREATE TRIGGER INSERT_T BEFORE INSERT ON dataT
for each row begin
IF(NEW.id IS NOT NULL)
SET NEW.id = 9999;
Missing THEN keyword.
MySQL Reference Manual: IF Syntax https://dev.mysql.com/doc/refman/5.7/en/if.html
And for your next questions. Yes, you need a semicolon following the END IF
And you need to specify a delimiter other than the default semicolon. e.g.
DELIMITER $$ CREATE TRIGGER ... END$$ DELIMITER ;