Re: Any Way to Defer Triggers?
Posted in 1997
Jacob Salomon wrote: > > David Mascorro wrote: > > > > I have a table that has an update trigger defined. There are > certain > > times when I need to run an update on this table without the trigger > > triggering. Is there a command I can execute that will temporarily > > turn off the trigger so I can run an update and then turn it back on > > afterwords? > > David, > you can disable a trigger with the following command: > SET TRIGGERS trigger-name DISABLED > > Then you do your updates with no triggers happening. Afterward you > re-enable the trigger by the command: > SET TRIGGERS trigger-name DISABLED Some thoughts from these wonderful online manuals: Privileges Required for Changing Object Modes To change the object mode of a constraint, index, or trigger, you must have the necessary privileges. Specifically, you must meet one of the following requirements: o You must have the DBA privilege on the database. o You must be the owner of the table on which the object is defined and must have the Resource privilege on the database. o You must have the Alter privilege on the table on which the object is defined and the Resource privilege on the database. Cheers, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //| | +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+