CREATE TABLE TBPSP_PIX (
    ID INTEGER NOT NULL,
    CODIGO INTEGER,
    DESCRICAO VARCHAR(200),
    STATUS INTEGER DEFAULT 1 NOT NULL,
    DATAHORA TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL);

ALTER TABLE TBPSP_PIX
ADD CONSTRAINT PK_TBPSP_PIX
PRIMARY KEY (ID);

COMMENT ON COLUMN TBPSP_PIX.CODIGO IS
'CODIGO DO BANCO';

COMMENT ON COLUMN TBPSP_PIX.STATUS IS
'STATUS DO REGISTRO
0 - INATIVO;
1 - ATIVO;';

CREATE SEQUENCE GTBPSP_PIX;

SET TERM ^ ;

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

SET TERM ; ^

