CREATE TRIGGER "tib_pl_tarif" BEFORE INSERT
ORDER 1 ON "DBA"."pl_tarif"
referencing new as new_name
for each row
begin
  declare id1 integer;
  if(new_name.tarifnr is null) or(new_name.tarifnr = 0) then
    select getid_pl_tarif() into id1 from DUMMY;
    set new_name.tarifnr=id1
  end if;
  set new_name.kell=Now(*);
  set new_name.kell2=Now(*);
end