title: ERROR 1064 (42000): check the manual that corresponds to your MySQL server version for the right syntax to use near 'END'
body: <p>here is mycode</p>
  
  <p>i am trying to create a trigger after insert on a table say product table to a change traker table called audit table</p>
  
  <p>like this</p>
  
  <pre><code>    DELIMITER //
      CREATE TRIGGER product_table_after_insert
      AFTER INSERT
      ON product_table FOR EACH ROW
  
     BEGIN
  
      DECLARE l_product_description varchar(500);
      DECLARE l_product_number int;
     set @l_table_name = 'product_table';
      set @l_action = 'INSERT';
     set  @l_table_column = 'all columns';
     set   @l_description = 'new row inserted';
  
      select p.product_description ,p.product_number into @l_product_description, @l_product_number from product_table p where p.product_description = (select max(pg.product_number)from product_table pg);
     -- Insert record into audit table
         INSERT INTO audit_table_test
       ( table_name,
       changed_row_id,
       action,
       table_column,
       change_desciption,
       change_time
       )
       VALUES
       ( l_table_name,
        l_product_number,
        l_action,
        l_table_column,
        l_description,
         SYSDATE()
         )
     END
     //
      DELIMITER ;
  </code></pre>
  
  <p>this is the error i am getting</p>
  
  <p>i tried all these ways</p>
  
  <p>used <code>|</code> ,<code>S</code> etc instead of // and</p>
  
  <p>removed <code>;</code> after end, placed <code>//</code> or <code>\</code> or <code>$$</code> together and below end</p>
  
  <p>nothing works, some one please help me</p>
  
  <pre><code>ERROR 1064 (42000): 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 'END' at line 32
  </code></pre>
  
  <p>some one please help me</p>