Subject Re: Update more than one column in only one row with a trigger:
Author fridge_n
Thanks Kanka ,
Your advice helped.

I have tried your code, it didn't work but it gave me the missing link I was looking for.
Problem solved!

Although I find the double “where field_1 = new.field_a” annoying the version beneath works fine:

as
begin
if (old.field_a is null and new.field_a>0) then
update table_2
set new.field_b = (select field_2 from table_1 where field_1 = new.field_a),
new.field_c = (select field_3 from table_1 where field_1 = new.field_a)
;
end


Regards,
fridge_n



--- In firebird-support@yahoogroups.com, Kanka sumatra <javakqj@...> wrote:
>
>
>  Have you tried this:
> as
> begin
> if (old.field_a is null and new.field_a> 0) then
> update table_2
> set (new.field_b) = (select field_2  from table_1),set ( new.field_c) = (select field_3 from table_1)
> where field_1 = new.field_a) ;
> end
>
> --kqj