ORACLE and TRIGGERS (inserted, updated, deleted)

Posted by vandalo on Stack Overflow See other posts from Stack Overflow or by vandalo
Published on 2010-06-03T11:37:18Z Indexed on 2010/06/03 11:54 UTC
Read the original article Hit count: 145

Filed under:
|

Hello,

I would like to use a trigger on table which will be fired every time a row is inserted, updated, deleted. I wrote something like this:

CREATE or REPLACE TRIGGER test001
  AFTER INSERT OR DELETE OR UPDATE ON tabletest001
  REFERENCING OLD AS old_buffer NEW AS new_buffer 
  FOR EACH ROW WHEN (new_buffer.field1 = 'HBP00') 

and it works. Since I would like to do the same things if the row is inserted, updated or deleted I would like to know what's happening in the trigger. I think I can manage to find if the row in inserted or updated (I can check the old_buffer with the new_buffer). How can I know if the row has been deleted?

Alberto

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about trigger