How can a TRIGGER be activated on demand?

Showing Answers 1 - 3 of 3 Answers

AiM

  • Aug 23rd, 2014
 

Trigger code to create a trigger in disable mode starting 11g

Code
  1. create or replace trigger prac_trig_emp1

  2. before insert or update OR DELETE

  3. ON emp1

  4. REFERENCING NEW AS NEW OLD AS OLD

  5. FOR EACH ROW DISABLE

  6. BEGIN

  7. IF INSERTING THEN

  8. INSERT INTO emp1_aud (a) VALUES (Insert)

  9. ELSIF DELETING THEN

  10. INSERT INTO emp1_aud (a) VALUES (Delete)

  11. ELSIF UPDATING THEN

  12. INSERT INTO emp1_aud (a) VALUES (Update)

  13. END IF

  14. END prac_trig_emp1

  15.  

  16.  

  17. ALTER TRIGGER prac_trig_emp1 enable

  18. ALTER TRIGGER prac_trig_emp1 disable


  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