CREATE SEQUENCE GTBPREVISAO_VENDA;

SET TERM ^ ;

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

SET TERM ; ^