Oracle triggers if inserting updating

Posted by / 20-Jan-2020 11:16

Triggers make understanding an existing system hard. During a code review, triggers are typically not even looked at in the context of the code being reviewed. The trigger is like a subroutine that is called over and over again.

A trigger is just like a subroutine , but most people consider triggers part of the DDL.

UTL_MAIL, UTL_SMTP, and UTL_TCP all suffer from the same problem: if the transaction that caused the trigger to fire rolls back, they’ll have performed operations that cannot be rolled back.

So, for anyone who writes triggers, the first rule of trigger coding is, “Do not perform any operation that cannot be rolled back.” Consider what happens if your trigger fires—the code executes—but the transaction rolls back.

This is perhaps the most frequent error made in the use of triggers—performing an operation that cannot be rolled back.

(Note that you do not need to perform the rollback yourself to have a rollback happen.

But dealing with incorrect implementation of triggers is another thing.And just as you would not review a CREATE TABLE statement while reviewing a package implementation, most people do not review the hidden code in a trigger.Incorrect Implementations The first reason I have for disliking triggers (the long-term maintenance headache) is merely an “I find them a pain in the neck” reason.Far too often, just anyone will create a trigger, without understanding the ramifications of doing so.For example, can you immediately see the huge bug in this trigger?

oracle triggers if inserting updating-25oracle triggers if inserting updating-75oracle triggers if inserting updating-85

As part of normal processing, Oracle Database rolls back updates, deletes, and merges all the time without telling you that it has done so.

One thought on “oracle triggers if inserting updating”

  1. Like with any website where you can chat with people through video, you can always expect to find some jokesters who are going to do some obscene things on camera.

  2. It's the polar opposite of both Getting Crap Past the Radar and Accidental Innuendo. " Compare Accidental Pun, where a non-sexual remark is misinterpreted as, well, a pun; Orgasmic Combat, when fighting sounds like...something else; and Have a Gay Old Time, when something sounds sexual because language marches on.