Subject Re: [firebird-support] altering triggers from sp
Author Martijn Tonies
Hi,

> is it possible to activate/deactivate trigger from stored procedure
> or trigger? I tried inserting alter trigger into the stored
> procedure body, but received an error (Token unknown).

You cannot write DDL in a stored procedure.

If you really really want to do this, you can do it via
EXECUTE STATEMENT in Firebird 1.5 -- but
deactivating triggers inside a stored procedure sounds
like a very bad idea and a hack to me.

> On the other hand maybe there is a better solution using
> transactions or triggers sequences. I have the trigger the do update
> on the table after some insert/update actions. What I want is to
> fire the trigger after a sequence of individual inserts/updates
> complete. The first thing I came up with is to deactivate trigger,
> and activate it before the last in the sequence.

This idea isn't multi-user safe anyway.

> Any help would be appreciated.
> I have Firebird 1.5.1.

What are these actions?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com