Subject | Re: [firebird-support] Adding trigger dynamically |
---|---|
Author | Teträm Corp |
Post date | 2008-11-16T18:48:18Z |
Hi,
if you know the name of the trigger, I think you can use:
select 1 from rdb$triggers where rdb$trigger_name = :trigger_name
but if you don't know the name, it will be more difficult
in the same table,
rdb$relation_name gives the name of the table
rdb$trigger_type gives the "actions" of the trigger (before insert,
before update, after insert or update, etc)
rdb$inactive to know if it is active or not
and may be rdb$flags and rdb$system_flag will be helpful but I don't all
possible values (just a few of them) and their meanings
Thierry
Harriv a écrit :
if you know the name of the trigger, I think you can use:
select 1 from rdb$triggers where rdb$trigger_name = :trigger_name
but if you don't know the name, it will be more difficult
in the same table,
rdb$relation_name gives the name of the table
rdb$trigger_type gives the "actions" of the trigger (before insert,
before update, after insert or update, etc)
rdb$inactive to know if it is active or not
and may be rdb$flags and rdb$system_flag will be helpful but I don't all
possible values (just a few of them) and their meanings
Thierry
Harriv a écrit :
>
> Hi,
>
> Is it possible to check if table has trigger defined and if trigger
> is missing add it? I'd like to my program to add it's own trigger when
> started if it doesn't exist.
>
> Also, are there any pitfalls when doing this kind of operation? I'm
> only used to modify database structure manually..
>
> I'm using Python and kinterbasdb if it matters.
>
>