CREATE TABLE TBPDV_MFE (
    ID INTEGER NOT NULL,
    PDV_ID INTEGER,
    NUMERO_SERIE_MFE INTEGER,
    DIGITO_VERIFICADOR INTEGER,
    MODELO VARCHAR(100),
    CODIGO_ATIVACAO VARCHAR(255),
    CODIGO_EMERGENCIA VARCHAR(255));

ALTER TABLE TBPDV_MFE
ADD CONSTRAINT PK_TBPDV_MFE
PRIMARY KEY (ID);

CREATE SEQUENCE GTBPDV_MFE;

SET TERM ^ ;

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

SET TERM ; ^


