CREATE SEQUENCE GTBCAMPANHA_ID;

SET TERM ^ ;

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

SET TERM ; ^
