Subject Re: [firebird-support] tricky trigger
Author Svein Erling Tysvaer
martinknappe wrote:
> what i've written is the following trigger but it doesnt work :-(
> CREATE trigger dicentries_bu0 for dicentries
> active before update position 0
> as
> declare variable wanted_id bigint;
> begin
> for select id from dicentries where asverwid = into :wanted_id do
> begin
> update dicentries
> set
> asverwterm = new.asterm
> where
> ID = :wanted_id;
> end
> end
> does any of you see why it doesnt work?

I don't think this problem has anything to do with recursion and that
the solution is very simple. BEFORE triggers should be used to modify
the values of the current record, modifying other records should be done
in AFTER triggers. So just change BEFORE UPDATE to AFTER UPDATE and try