CREATE TABLE TBGP_ETAPA_PMP_COLUNA (
    ID INTEGER NOT NULL,
    GP_ETAPA_PMP_ID INTEGER,
    DESCRICAO VARCHAR(200),
    TIPO_CAMPO INTEGER,
    FORMULA BLOB SUB_TYPE 1 SEGMENT SIZE 80);

ALTER TABLE TBGP_ETAPA_PMP_COLUNA
ADD CONSTRAINT PK_TBGP_ETAPA_PMP_COLUNA
PRIMARY KEY (ID);

COMMENT ON COLUMN TBGP_ETAPA_PMP_COLUNA.TIPO_CAMPO IS 
'1 - DATA
2 - TEXTO';

CREATE SEQUENCE GTBGP_ETAPA_PMP_COLUNA;

create trigger ttbgp_etapa_pmp_coluna_b01i for tbgp_etapa_pmp_coluna
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbgp_etapa_pmp_coluna,1);
end;
