title: How to use SQL trigger to record the affected column's row number
body: <p>I want to have an 'updateinfo' table in order to record every update/insert/delete operations on another table.</p>
  
  <p>In oracle I've written this:</p>
  
  <p>CREATE TABLE updateinfo ( rnumber NUMBER(10), tablename VARCHAR2(100 BYTE), action VARCHAR2(100 BYTE), UPDATE_DATE date )</p>
  
  <p>DROP TRIGGER TRI_TABLE;<br>
  CREATE OR REPLACE TRIGGER TRI_TABLE<br>
  AFTER DELETE OR INSERT OR UPDATE<br>
  ON demo<br>
  REFERENCING NEW AS NEW OLD AS OLD<br>
  FOR EACH ROW<br>
  BEGIN<br>
  if inserting then<br>
  insert into updateinfo(rnumber,tablename,action,update_date ) values(rownum,'demo', 'insert',sysdate);<br>
      elsif updating then<br>
      insert into updateinfo(rnumber,tablename,action,update_date ) values(rownum,'demo', 'update',sysdate);<br>
      elsif  deleting then<br>
     insert into updateinfo(rnumber,tablename,action,update_date ) values(rownum,'demo', 'delete',sysdate);<br>
      end if;<br>
   --  EXCEPTION<br>
   --   WHEN OTHERS THEN<br>
         -- Consider logging the error and then re-raise<br>
    --   RAISE;<br>
  END TRI_TABLE;  </p>
  
  <p>but when checking updateinfo, all rnumber column is zero.
  is there anyway to retrieve the correct row number?</p>