Here's the create statement pulled out of the database itself for a trigger:

CREATE DEFINER=`walkdot_logan`@`` 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;

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.

  • Have you tried with INSERT INTO ... VALUES (SYSDATE(), 'artists', CONCAT('code:', NEW.code, ';') ); – ypercubeᵀᴹ Jun 9 '15 at 21:38
  • @ypercube - Yes. I've also tried doing something simple like a select * from table;. It's always complaining about that missing semi-colon. What's weirder is that if I put a second semi-colon there it complains saying that it's not valid, while still showing the original error. It's like it knows it's there, but not 100% – Logarr Jun 9 '15 at 21:40
  • 1
    Oh, didn't notice, you need to use DELIMITER. See the examples – ypercubeᵀᴹ Jun 9 '15 at 21:42

Browse other questions tagged or ask your own question.