title: problema creating a trigger in oracle to update other table
body: <p>i'm creating a trigger to update other table to audit.
  My main table that is being audited is "employed" and the audit table is "salary_history". Every a update is made in emplyed table the salary_history must be updated.
  I'm working with this trigger in oracle 11g:</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER salary_auditing
  AFTER UPDATE ON employed
  REFERENCING NEW AS NEW OLD AS OLD
  BEGIN
  
    INSERT INTO SALARY_HISTORY(ID, EMPLOYED_ID, OLD_SALARY, NEW_SALARY, DATE_MODIFIED) VALUES (SELECT MAX(ID)+1 FROM SALARY_HISTORY, ID, :OLD.salary, :NEW.salary, SYSDATE)
  
  END salary_auditing
  </code></pre>
  
  <p>The problema is that when i run this trigger i receive this error:</p>
  
  <pre><code>Relatório de erros -
  ORA-04082: referências NEW ou OLD não permitidas nos gatilhos de nível de tabela
  04082. 00000 -  "NEW or OLD references not allowed in table level triggers"
  *Cause:    The trigger is accessing "new" or "old" values in a table trigger.
  *Action:   Remove any new or old references.
  </code></pre>
  
  <p>In english it means that the NEW or OLD values is not allowed at table nivel.</p>
  
  <p>what modifications i should do?</p>