CREATE TRIGGER "tdb_pv_kanne" BEFORE DELETE
ORDER 1 ON "DBA"."pv_kanne"
REFERENCING OLD AS old_name
FOR EACH ROW
BEGIN
  if years(old_name.kuup)>2020 then
    call pr_kanne_add(month(old_name.kuup),years(old_name.kuup),old_name.yksusnr,6);
  end if;
END