Oracle trigger if updating then
Oracle fires all triggers of a type, then all triggers of another type, and so on.You have no control over which type is fired first, and whichever type is fired after the first type will see any changes made by the first type, and that cascades down (third type sees changes made by the second type, and so on). There are a great many things you can do with triggers, whether they are based on DML statements or system events.Thus you check this trigger by Inserting a row in Superheroes table.Update Trigger is the one which will execute either before or after Update DML.Finally, the mutating table error, ORA-04091 table owner.table_name is mutating, trigger/function may not see it has made DBAs trigger-happy in ways we would rather they not be exposed to. As a developer or DBA (or both), there is no such thing as having too many tricks up your sleeve.In terms of job or role separation, you can think of the DML triggers as being in the purview of the developer, and the system event triggers being in the DBA's, but a good DBA should possess some decent programming skills of his or her own, and that's where knowing how to avoid problems with DML triggers comes into play.The DML triggers are the best known, but there are more available since Oracle8i was released.The additional triggers, or types of triggers, are instead-of triggers, database event triggers, and DDL triggers.
Suppose you have a banking application with a trigger that checks to see if the DML operation is occurring after business hours (assuming that it should only be performed during business hours).CREATE OR REPLACE TRIGGER bu_Superheroes BEFORE DELETE ON superheroes FOR EACH ROW ENABLE DECLARE v_user VARCHAR2 (15); BEGIN SELECT user INTO v_user FROM dual; DBMS_OUTPUT.PUT_LINE('You Just Deleted a Row Mr.'