0
CREATE TRIGGER age_trigger BEFORE INSERT ON kids FOR EACH ROW 
BEGIN 
IF (NEW.age < 0) THEN SET NEW.age = NEW.age * -1;
END IF;
END;

I am getting an error:

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 '' at line 5

I have tried removing the if/else, hardcoding NEW.AGE = 50, and looked at examples online. My syntax matches online examples, but I keep getting the same error. I don't believe its my version of MySQL. Thoughts?

jarlh
  • 42,561
  • 8
  • 45
  • 63
webdesignnoob
  • 381
  • 1
  • 4
  • 13

0 Answers0