title: SQL Trigger After Update Insert data into another table
body: <p>I have two table. One is customer_info and another one is update_log. I want to create a trigger that will execute after update in customer_info. If <code>cust_name, Contact</code> is updated then <code>cust_no, Cust_name, Contact, Date</code> will be added to second table. Second table will have two row with old data and new data. my code is not working. Any help will be highly appreciated.</p>
  
  <pre><code>CREATE  TRIGGER  update_trigger
  AFTER UPDATE  ON CUSTOMER_info
  FOR EACH ROW
  BEGIN
    IF NEW.cust_name &lt;&gt; OLD.cust_name || NEW.contact &lt;&gt; OLD.contact then
      insert into update_log values 
      ( OLD.cust_no,OLD.cust_name, OLD.contact, CURRENT_DATE); 
  
      insert into update_log  values
      ( NEW.cust_no,NEW.cust_name, NEW.contact,CURRENT_DATE);                 
    END IF
  END
  </code></pre>