Subject Re: [ib-support] Trigger not working
Author Svein Erling Tysvaer
Rod, what is waybill? Is it the PK column or are you trying to update
several records in the routing table? In general, I think edits to the
table you are creating the trigger for is supposed to go into a BEFORE
INSERT/UPDATE/DELETE trigger, not the corresponding AFTER trigger. I am a
bit more uncertain where you are supposed to do things if you want to
update several records, but with the problem you describe, my first hunch
is that you ought to change AFTER to BEFORE.


At 12:37 22.08.2002 +0000, you wrote:
>I have a trigger :
>set term ^ ;
>create trigger trig_routing_export for routing
>after update as
> begin
> if (old.export <> 1) then
> update routing
> set export = 1
> where waybill = new.waybill;
> end^
>set term ; ^
>Now if I go into IBConsole and edit a load of records on the routing
>table by selecting an arbitary column, inserting a valid value then
>down arrow - the 'export' field only sometimes changes to 1 ( in the
>current situation all the export values started at 0 ). I cannot pick
>up a pattern - but obviously for each edit I need export = 1.