CREATE TRIGGER "tib_ls_mooturid" BEFORE INSERT
ORDER 1 ON "DBA"."ls_mooturid"
referencing new as new_name
for each row
begin
  declare id1 integer;
  if(new_name.id is null) or(new_name.id = 0) then
    select getid_klassiflist('ls_mooturid','id') into id1 from DUMMY;
    set new_name.id = id1
  end if;
end