I think this is exactly what I was searching for, thank you very much! I just tried it on a H2-Database and don't know what I did wrong, maybe you could help me there too. My trigger looks like this:
create trigger transaction_trig_value_ai after isert of value on transaction
declare
v_value double;
v_type_category boolean;
cursor c_value IS SELECT value from transaction where id = :NEW.idcategory;
cursor c_type_kategorie IS SELECT type from category where id = :NEW.idcategory;
begin
open c_value;
fetch c_value into v_value;
close c_value;
open c_type_category;
fetch c_type_category into v_type_category;
close c_type_category;
if v_type_category == 0 then
update bankaccount
set value = value + v_value;
end if;
if v_type_category == 1 then
update bankaccount
set value = value - v_value;
end if;