ALTER TRIGGER "tib_pl_lahet" BEFORE INSERT
ORDER 1 ON "DBA"."pl_lahet"
referencing new as new_name
for each row
begin
  declare id1 integer;
  if(new_name.lahetnr is null) or(new_name.lahetnr = 0) then
    select getid_pl_lahet() into id1 from DUMMY;
    set new_name.lahetnr=id1
  end if;
  set new_name.kell=Now(*)
end