Subject Re: [firebird-support] Deactivate triggers inside EXECUTE BLOCK
Author Mr. John
thanks

On Monday, May 7, 2018, 12:43:40 PM GMT+3, Dimitry Sibiryakov sd@... [firebird-support] <firebird-support@yahoogroups.com> wrote:


07.05.2018 7:43, 'Mr. John' mr_johnmr@... [firebird-support] wrote:
> I'm looking for a way to run a simple update on couple tables without calling triggers

  Modify 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.



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-digest@yahoogroups.com
    firebird-support-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/