CREATE SEQUENCE GTBFICHA_TEMPLATE_ITENS;

SET TERM ^ ;

create trigger ttbficha_template_itens_b01i for tbficha_template_itens
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbficha_template_itens,1);
end
^

SET TERM ; ^