Subject Re: Activating and de-activating triggers in SP
Author Adam
--- In firebird-support@yahoogroups.com, "Sudheer Palaparambil"
<sudheer.clt@g...> wrote:
>
> Hi,
>
> Can I have a SP like this ? I don't want to fire the 'after insert
> trigger'
> on table instant_purchase for this particular insert. Is it safe ?
>

Cant answer your question about whether it is safe, but what you can
do is create a field in the table to control the trigger fire.

ALTER TABLE INSTANT_PURCHASE ADD RUNTRIGGER CHAR(1) DEFAULT 'T';

CREATE TRIGGER TR_INSTANT_PURCHASE_AI FOR INSTANT_PURCHASE
ACTIVE AFTER INSERT POSITION 0
AS
BEGIN
IF (NEW.RUNTRIGGER = 'F') THEN EXIT;

....
END
^

etc

Then you can safely not do whatever your trigger does. "Temporarily"
disabling triggers seems very close to mixing DDL and DML.

Adam