CREATE TABLE TXSAFX07 AS SELECT * FROM SAFX07
/
TRUNCATE TABLE TXSAFX07
/
ALTER TABLE TXSAFX07 ADD CDFILIAL VARCHAR2(4) 
/ 
ALTER TABLE TXSAFX07 ADD CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX07 ADD IDSTATRANSM VARCHAR2(1)
/
ALTER TABLE TXSAFX07 ADD IDLOTE VARCHAR2(70)
/
ALTER TABLE TXSAFX07 ADD IDPROTOCOLO VARCHAR2(70)
/
ALTER TABLE TXSAFX07 ADD IDPROCE VARCHAR2(10)
/
ALTER TABLE TXSAFX07 ADD DSOBSERVERRO VARCHAR2(200)
/
ALTER TABLE TXSAFX07 ADD DSOBSERVESOL VARCHAR2(200)
/
ALTER TABLE TXSAFX07 ADD NRSEQLOTE VARCHAR2(5)
/
ALTER TABLE TXSAFX07 ADD NRSEQVENDA VARCHAR2(10)
/

ALTER TABLE TXSAFX07 MODIFY CDFILIAL VARCHAR2(4)
/
ALTER TABLE TXSAFX07 MODIFY CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX07 MODIFY NRSEQVENDA VARCHAR2(10)
/
ALTER TABLE TXSAFX07 MODIFY IDSTATRANSM VARCHAR2(1)
    CONSTRAINT CKC_TXSAFX07_IDSTATRANSM CHECK (IDSTATRANSM IN ('S', 'N'))
/
ALTER TABLE TXSAFX07 MODIFY NRORG NUMBER DEFAULT SYS_CONTEXT('NRORG_CTX', 'NRORG')
/
ALTER TABLE TXSAFX07 MODIFY IDATIVO VARCHAR2(1) DEFAULT 'S'
    CONSTRAINT TXSAFX07_IDATIVO_CK CHECK (IDATIVO IN ('S', 'N'))
/
ALTER TABLE TXSAFX07 ADD CONSTRAINT PK_TXSAFX07 PRIMARY KEY (CDFILIAL, CDCAIXA, NRSEQVENDA )
/
CREATE INDEX TXSAFX07_IDX1 ON TXSAFX07 (CDFILIAL, IDSTATRANSM)
/
CREATE INDEX TXSAFX07_IDX2 ON TXSAFX07 (IDSTATRANSM)
/
CREATE TABLE TXSAFX08 AS SELECT * FROM SAFX08
/
TRUNCATE TABLE TXSAFX08
/
ALTER TABLE TXSAFX08 ADD CDFILIAL  VARCHAR2(4)
/
ALTER TABLE TXSAFX08 ADD CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX08 ADD NRSEQVENDA VARCHAR2(10)
/
ALTER TABLE TXSAFX08 ADD IDSTATRANSM VARCHAR2(1)
/
ALTER TABLE TXSAFX08 ADD IDLOTE VARCHAR2(70)
/
ALTER TABLE TXSAFX08 ADD IDPROTOCOLO VARCHAR2(70)
/
ALTER TABLE TXSAFX08 ADD IDPROCE VARCHAR2(10)
/
ALTER TABLE TXSAFX08 ADD DSOBSERVERRO VARCHAR2(200)
/
ALTER TABLE TXSAFX08 ADD DSOBSERVESOL VARCHAR2(200)
/
ALTER TABLE TXSAFX08 ADD NRSEQLOTE VARCHAR2(5)
/

ALTER TABLE TXSAFX08 MODIFY CDFILIAL VARCHAR2(4)
/
ALTER TABLE TXSAFX08 MODIFY CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX08 MODIFY NRSEQVENDA VARCHAR2(10)
/
ALTER TABLE TXSAFX08 MODIFY IDSTATRANSM VARCHAR2(1)
    CONSTRAINT CKC_TXSAFX08_IDSTATRANSM CHECK (IDSTATRANSM IN ('S', 'N'))
/
ALTER TABLE TXSAFX08 MODIFY NRORG NUMBER DEFAULT SYS_CONTEXT('NRORG_CTX', 'NRORG')
/
ALTER TABLE TXSAFX08 MODIFY IDATIVO VARCHAR2(1) DEFAULT 'S'
    CONSTRAINT CKC_TXSAFX08_IDATIVO CHECK (IDATIVO IN ('S', 'N'))
/

ALTER TABLE TXSAFX08 ADD CONSTRAINT PK_TXSAFX08 PRIMARY KEY (CDFILIAL, CDCAIXA, NRSEQVENDA, NUM_ITEM)
/
CREATE INDEX TXSAFX08_IDX1 ON TXSAFX08 (CDFILIAL, CDCAIXA, NRSEQVENDA)
/
CREATE INDEX TXSAFX08_IDX2 ON TXSAFX08 (CDFILIAL, IDSTATRANSM)
/
CREATE INDEX TXSAFX08_IDX3 ON TXSAFX08 (IDSTATRANSM)
/

CREATE TABLE TXSAFX201 AS SELECT * FROM SAFX201
/
TRUNCATE TABLE TXSAFX201
/
ALTER TABLE TXSAFX201 ADD CDFILIAL  VARCHAR2(4)
/

ALTER TABLE TXSAFX201 ADD CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX201 ADD NRSEQVENDA VARCHAR2(10)
/
ALTER TABLE TXSAFX201 ADD IDSTATRANSM VARCHAR2(1)
/
ALTER TABLE TXSAFX201 ADD IDLOTE VARCHAR2(70)
/
ALTER TABLE TXSAFX201 ADD IDPROTOCOLO VARCHAR2(70)
/
ALTER TABLE TXSAFX201 ADD IDPROCE VARCHAR2(10)
/
ALTER TABLE TXSAFX201 ADD DSOBSERVERRO VARCHAR2(200)
/
ALTER TABLE TXSAFX201 ADD DSOBSERVESOL VARCHAR2(200)
/
ALTER TABLE TXSAFX201 ADD NRSEQLOTE VARCHAR2(5)
/
ALTER TABLE TXSAFX201 MODIFY CDFILIAL VARCHAR2(4)
/
ALTER TABLE TXSAFX201 MODIFY CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX201 MODIFY NRSEQVENDA VARCHAR2(10)
/
ALTER TABLE TXSAFX201 MODIFY IDSTATRANSM VARCHAR2(1)
    CONSTRAINT CKC_TXSAFX201_IDSTATRANSM CHECK (IDSTATRANSM IN ('S', 'N'))
/
ALTER TABLE TXSAFX201 MODIFY NRORG NUMBER DEFAULT SYS_CONTEXT('NRORG_CTX', 'NRORG')
/
ALTER TABLE TXSAFX201 MODIFY IDATIVO VARCHAR2(1) DEFAULT 'S'
    CONSTRAINT CKC_TXSAFX201_IDATIVO CHECK (IDATIVO IN ('S', 'N'))
/
ALTER TABLE TXSAFX201 ADD CONSTRAINT PK_TXSAFX201 PRIMARY KEY (CDFILIAL, CDCAIXA, NRSEQVENDA)
/
CREATE INDEX TXSAFX201_IDX1 ON TXSAFX201 (CDFILIAL, CDCAIXA, NRSEQVENDA)
/
CREATE INDEX TXSAFX201_IDX2 ON TXSAFX201 (CDFILIAL, IDSTATRANSM)
/
CREATE INDEX TXSAFX201_IDX3 ON TXSAFX201 (IDSTATRANSM)
/

CREATE TABLE TXSAFX202 AS SELECT * FROM SAFX202
/
TRUNCATE TABLE TXSAFX202
/
ALTER TABLE TXSAFX202 ADD CDFILIAL VARCHAR2(4)
/
ALTER TABLE TXSAFX202 ADD CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX202 ADD NRSEQVENDA VARCHAR2(10)
/
ALTER TABLE TXSAFX202 ADD IDSTATRANSM VARCHAR2(1)
/
ALTER TABLE TXSAFX202 ADD IDLOTE VARCHAR2(70)
/
ALTER TABLE TXSAFX202 ADD IDPROTOCOLO VARCHAR2(70)
/
ALTER TABLE TXSAFX202 ADD IDPROCE VARCHAR2(10)
/
ALTER TABLE TXSAFX202 ADD DSOBSERVERRO VARCHAR2(200)
/
ALTER TABLE TXSAFX202 ADD DSOBSERVESOL VARCHAR2(200)
/
ALTER TABLE TXSAFX202 ADD NRSEQLOTE VARCHAR2(5)
/

ALTER TABLE TXSAFX202 MODIFY CDFILIAL VARCHAR2(4)
/
ALTER TABLE TXSAFX202 MODIFY CDCAIXA VARCHAR2(3)
/
ALTER TABLE TXSAFX202 MODIFY NRSEQVENDA VARCHAR2(10)
/
ALTER TABLE TXSAFX202 MODIFY IDSTATRANSM VARCHAR2(1)
    CONSTRAINT CKC_TXSAFX202_IDSTATRANSM CHECK (IDSTATRANSM IN ('S', 'N'))
/
ALTER TABLE TXSAFX202 MODIFY NRORG NUMBER DEFAULT SYS_CONTEXT('NRORG_CTX', 'NRORG')
/
ALTER TABLE TXSAFX202 MODIFY IDATIVO VARCHAR2(1) DEFAULT 'S'
    CONSTRAINT CKC_TXSAFX202_IDATIVO CHECK (IDATIVO IN ('S', 'N'))
/
ALTER TABLE TXSAFX202 ADD CONSTRAINT PK_TXSAFX202 PRIMARY KEY (CDFILIAL, CDCAIXA, NRSEQVENDA, NUM_ITEM)
/
CREATE INDEX TXSAFX202_IDX1 ON TXSAFX202 (CDFILIAL, CDCAIXA, NRSEQVENDA)
/
CREATE INDEX TXSAFX202_IDX2 ON TXSAFX202 (CDFILIAL, IDSTATRANSM)
/
CREATE INDEX TXSAFX202_IDX3 ON TXSAFX202 (IDSTATRANSM)
/
INSERT INTO CADASTROPROJETO (CDPROJETO, IDPROJETO, DSPROJETO) 
    VALUES('024', '24', 'TAX ONE')
/
INSERT INTO PLATAFORMAVEND (CDPLATAFORMAVEND, NMPLATAFORMAVEND, IDPLATAFORMAVEND) 
    VALUES ('023', 'TAX ONE', 'TXO')
/
COMMIT
/

ALTER TABLE GERPARAMGERAL ADD DSUSRTAXAPI VARCHAR2(100)
/
ALTER TABLE GERPARAMGERAL ADD DSPSWTAXAPI VARCHAR2(100)
/
ALTER TABLE GERPARAMGERAL ADD CDURLTAXONE VARCHAR2(250)
/
