Triggers

Question: How can I Disable Triggers Temporarily?

I have tables with update and insert triggers and there are times that I want to work with them for maintenance and not have the triggers fire. Can I do this without dropping and recreating the triggers?

Answer: Disable the triggers.

You can use a SET TRIGGERS trigger_name DISABLED statement. When you finish your work, run a SET TRIGGERS trigger_name ENABLED command. The system will not attempt to go back and run the triggers, but instead will continue as though all triggers had fired correctly during the manipulations. You are responsible to be sure that any referential integrity that may have been enforced by the triggers is handled manually, so be careful in using this.

Get Informix DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.