Code: Select all
create trigger upd_posten after insert on "Transacties"
referencing new row as newrow
for each row
begin atomic
if newrow."Relatie" = '(mijzelf)' and
newrow."Mededeling" like '%999999999%'
then update "Posten"
set "Totaal posten" = "Totaal posten" + newrow."Bedrag"
where "Posten" like ' extra overboeking %';
else if newrow."Relatie" = '(mijzelf)' and
newrow."Mededeling" like '%PAYPAL%'
then update "Posten"
set "Totaal posten" = "Totaal posten” + newrow."Bedrag"
where "Posten" like ' betaling aan paypa%';
else
update "Posten"
set "Totaal posten" = "Totaal posten” + newrow."Bedrag"
where "Posten" in (
select "Rel Post" from "Relaties"
where "Rel Naam" = newrow."Relatie”);
end if;
end
unexpected end of statement: required: IF : line: 25
I tried other constructions with "if then" and also with “case when”, but I can’t get it working.
Any suggestions would be much appreciated!
I'm trying this on my Imac (macOS Big Sur 11.1) with Open Office (4.1.9) HSQLDB 2.3.2