create procedure upd_faktura(f int,t int,m int)

         define c money;

         select cena into c from tovar where id_tovar = t;

         let c = c*m;

         update faktura set cena = cena + c

         where cislo_f = f;

         end procedure;

 

 

 

 

create trigger ins_riadok insert on riadok

    referencing new as n

    for each row

        (

        execute procedure upd_faktura(n.cislo_f ,n.id_tovar ,n.mnozstvo )

);