Re: triggering in 7.31
Posted in 2008
>"scottishpoet" <dryburghj@yahoo.com> wrote in message >news:f76d5ddb-9a86-4da9-be8a->0c43d2ab3e7e@2g2000hsn.googlegroups.com... >On Sep 24, 7:36 am, "ECS" <z...@mailinator.com> wrote: >> An update trigger was created on a few fields of a table. >> The trigger is activated even if another field is updated. >> Is this a bug in 7.31.FC6? >> >> Thanks > >I believe a trigger is created on a table, not on a field(column) of >a table. > >If you have an update trigger on the table the trigger will be >activated every time the table is updated. >It should only take the action documented in the trigger if the fields >affect change appropriately. So, any change on one of the 10 columns of table "oldb17b".table1 will activated this trigger. Correct?? I thought that it would only be activated by changes on colm1, 2 of 3, not on changes on colm4 - 10. create trigger "oldb17b".upd_table1 update of colm1, colm2, colm3 on "oldb17b".table1 referencing new as changedrow for each row ( insert into "oldb17b".trg_table1 ( messagestatus, triggersequence, colm1, colm2, colm3 ) values ( 'U', NULL, changedrow.colm1, changedrow.colm2, changedrow.colm3 ) );