|Database Triggers Overview - An introduction to database triggers in Oracle.|
poelger said...Maybe you should warn in your article about using non-transactional operations(package variables, autonomous transactions, ...) in triggers.
Oracle can restart DML statements.
I described this at our blog:
And it is discussed on the Pl/SQL Challenge blog:
Good point. I've added it into the the "Should you use triggers at all?" section.
lesio said...Very good article. DML restarts are kind of shock :p
About the behaviour in merge statements:
-- Include any code specific for when the trigger is fired from a MERGE.
-- A merge is not recognized as either of the three conditions, so it is implied.
It seems this was more or less a bug prior to 11g2. From this version on a generic statement trigger fires twice, oce with UPDATING=TRUE and once with INSERTING=TRUE
Thanks for the heads-up. I've corrected the article and included the way the fact the delete is not triggered for a delete clause of a merge. :)