CREATE TRIGGER "tib_pa_kaader_tun" BEFORE INSERT
ORDER 1 ON "DBA"."pa_kaader_tun"
REFERENCING NEW AS new_name
FOR EACH ROW
BEGIN
  declare id1 integer;
  if(new_name.asutunnr is null) or(new_name.asutunnr = 0) then
    select getid_pa_kaader_tun(*) into id1 from DUMMY;
    set new_name.asutunnr=id1
  end if
END