ALTER TABLE TBREMESSA_OPERACAO
    ADD ID INTEGER;

CREATE SEQUENCE GTBREMESSA_OPERACAO;

SET TERM ^ ;

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

SET TERM ; ^

update TBREMESSA_OPERACAO a set a.id = gen_id(gtbremessa_operacao,1);