title: PL/SQL TRIGGER for updating
body: <p>I have two tables <code>emp</code> &amp; <code>copy_emp</code> with same structure and same datas.
  I want if any changes occurred in <code>emp</code> should be reflect in <code>copy_emp</code>.
  Hence i created a trigger which i gave below.</p>
  
  <pre><code>create or replace trigger t
  after
  insert or
  update of empno or
  delete
  on emp
  for each row
  begin
  case
  when inserting then
    insert into copy_emp(empno,ename,sal) values (:NEW.empno,:NEW.ename,:NEW.sal);
  when updating then
    if updating('empno') then
      update copy_emp set copy_emp.empno=:new.empno where copy_emp.empno=:old.empno;
    elsif updating('ename') then
      update copy_emp set copy_emp.ename=:new.ename where copy_emp.ename=:old.ename;
    elsif updating('sal') then
      update copy_emp set copy_emp.sal=:new.sal where copy_emp.sal=:old.sal;
  end if;
  when deleting then
    delete from copy_emp where empno = :old.empno;
  end case;
  end;
  </code></pre>
  
  <p>Trigger got created without any errors and inserting and deleting work fine.
  problem is with updating. when i update <code>empno</code> column in <code>emp</code> table, it also get updated in <code>copy_emp</code> table. but when i update <code>ename</code> or <code>sal</code> column it only get updated in <code>emp</code> table but not in <code>copy_emp</code> table. Please help.  </p>