Oracle if inserting or updating then

Posted by / 09-Jun-2015 23:45

g_change_INSERT INTO tab1_audit VALUES g_change_tab(i); g_change_tab.delete; END AFTER STATEMENT; END tab1_compound_trigger; / From a timing point perspective, the Compound Trigger Restrictions follow very closely with those of individual statement and row level triggers.

CREATE OR REPLACE TRIGGER tab1_compound_trigger FOR INSERT OR UPDATE ON tab1 COMPOUND TRIGGER TYPE t_change_tab IS TABLE OF tab1_audit%ROWTYPE; g_change_tab t_change_tab := t_change_tab(); AFTER EACH ROW IS BEGIN g_change_tab.extend; g_change_tab(g_change_tab.last):= tab1_audit_seq.

If multiple compound triggers are defined for the same object, their order of execution can be controlled using the clause, but this cannot be used to control execution order when both compound and regular DML triggers are defined against a single object.

In such situations it is better to stick with all DML triggers, or all compound triggers.

END BEFORE STATEMENT; BEFORE EACH ROW IS BEGIN NULL; -- Do something here.

END BEFORE EACH ROW; AFTER EACH ROW IS BEGIN NULL; -- Do something here.

oracle if inserting or updating then-59oracle if inserting or updating then-65oracle if inserting or updating then-34

The CREATE TRIGGER statement has a lot of permutations, but the vast majority of the questions I'm asked relate to basic DML triggers.

One thought on “oracle if inserting or updating then”