Compund Triggers

Explain the concept of compond triggers

Questions by balu.kolla

Showing Answers 1 - 3 of 3 Answers

neeraj06.in

  • Nov 10th, 2011
 

Compound Triggers:
-> It combines all DML timing events into single trigger body.
-> It also resolves mutating table error and enhance the code maintenance.
-> The memory variables are persistent till execution finishes.

Example:

Code
  1. CREATE OR REPLACE TRIGGER [TRIGGER NAME]

  2. FOR [DML] ON [TABLE NAME]

  3. COMPOUND TRIGGER

  4. -- Initial section

  5. -- Declarations

  6. -- Subprograms

  7. Optional section

  8. BEFORE STATEMENT IS

  9. …;

  10. Optional section

  11. AFTER STATEMENT IS

  12. …;

  13. Optional section

  14. BEFORE EACH ROW IS

  15. …;

  16. Optional section

  17. AFTER EACH ROW IS

  18. …;

  19. END;

  20.  



For views, the trigger body contains INSTEAD OF EACH ROW section.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions