Subject Re: [ib-support] Trigger not working
Author Martijn Tonies
Hi,

Notice that "(old.export <> 1)" does not care
about NULL values in the old.export column. Perhaps
that's your problem?

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."

>
> 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.
>
> I did try 'where waybill = old.waybill' - no difference.
>
> IB ver 6.00