Subject | Re: Activating and de-activating triggers in SP |
---|---|
Author | Adam |
Post date | 2005-12-06T04:38:13Z |
--- In firebird-support@yahoogroups.com, "Sudheer Palaparambil"
<sudheer.clt@g...> wrote:
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
<sudheer.clt@g...> wrote:
>Cant answer your question about whether it is safe, but what you can
> 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 ?
>
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