Subject | Re: [firebird-support] Deactivate triggers inside EXECUTE BLOCK |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2018-05-07T09:43:39Z |
07.05.2018 7:43, 'Mr. John' mr_johnmr@... [firebird-support] wrote:
like that:
EXECUTE BLOCK AS
declare variable dummy integer;
BEGIN
dummy = RDB$SET_CONTEXT('USER_TRANSACTION', 'DO_NOT_FIRE_TRIGGERS', 'YES');
UPDATE TABLE1 set FIELD1=0 WHERE FIELD1=1;
dummy = RDB$SET_CONTEXT('USER_TRANSACTION', 'DO_NOT_FIRE_TRIGGERS', 'NO');
END
--
WBR, SD.
> I'm looking for a way to run a simple update on couple tables without calling triggersModify your trigger to check some context variable and skip actions. Then do something
like that:
EXECUTE BLOCK AS
declare variable dummy integer;
BEGIN
dummy = RDB$SET_CONTEXT('USER_TRANSACTION', 'DO_NOT_FIRE_TRIGGERS', 'YES');
UPDATE TABLE1 set FIELD1=0 WHERE FIELD1=1;
dummy = RDB$SET_CONTEXT('USER_TRANSACTION', 'DO_NOT_FIRE_TRIGGERS', 'NO');
END
--
WBR, SD.