title: MySQL 5.7 Create Trigger Syntax Error?
body: <p>I've been trying to create a simple <code>BEFORE INSERT</code> trigger on a database table (MySQL v 5.7 ) but I keep receiving a vague "#1064 ... syntax error" message which doesn't help resolve the issue. </p>
  
  <p>Here's the SQL:</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER `CREATE_QUIZ_TRIG` BEFORE INSERT ON `quiz`
   FOR EACH ROW BEGIN
      SET NEW.ACTIVE = UPPER(NEW.ACTIVE);
      SET NEW.CREATED = NOW();
   END
  /
  </code></pre>
  
  <p>All I'm trying to do is enforce a column to uppercase and then insert the current date &amp; time into a timestamp column. I've been following the documentation from:</p>
  
  <p><a href="https://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html" rel="nofollow noreferrer">https://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html</a></p>
  
  <p>and realise that for multi-statement expression I have to redefine the delimiter at the beginning of the trigger's creation but the same '#1064' error occurs.</p>
  
  <p>This is made even more confusing because when I use phpmyadmin's interface for creating the same trigger it works fine - but won't when I export the generated SQL and try to create the trigger using that!? </p>
  
  <p>Thanks for any help</p>