CREATE TABLE INTEGRACARDPME (
    NRINTEGRACARDPME NUMBER           NOT NULL,
    IDTIPO            NUMBER          NOT NULL,
    CDINTEGRA         NUMBER          NOT NULL,
    NMINTEGRA         VARCHAR2(60)    NOT NULL,
    NRORG             NUMBER 	      DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 		NOT NULL,
    IDATIVO           VARCHAR2(1)     DEFAULT 'S'					NOT NULL,
    DTINCLUSAO        DATE            DEFAULT SYSDATE,
    DTULTATU          DATE            DEFAULT SYSDATE,
    NRORGINCLUSAO     NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERINCLUSAO    VARCHAR2(12)    DEFAULT '1' 					NULL,
    NRORGULTATU       NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERULTATU      VARCHAR2(12)    DEFAULT '1',
        CONSTRAINT CKC_IDATIVO_INTEGRACARDPME CHECK (IDATIVO IN ('S','N')),
        CONSTRAINT PK_INTEGRACARDPME PRIMARY KEY(NRINTEGRACARDPME)
)
/

ALTER TABLE GRUPTIPOCARD ADD NRINTEGRACARDPME NUMBER
/
ALTER TABLE GRUPTIPOCARD ADD 
    CONSTRAINT FKPME00094INTEGRACARDPME FOREIGN KEY (NRINTEGRACARDPME) 
        REFERENCES INTEGRACARDPME (NRINTEGRACARDPME)
/

CREATE INDEX PME00094_FK ON GRUPTIPOCARD(NRINTEGRACARDPME)
/

ALTER TABLE GRUPSERV ADD NRINTEGRACARDPME NUMBER
/
ALTER TABLE GRUPSERV ADD 
    CONSTRAINT FKPME00095INTEGRACARDPME FOREIGN KEY (NRINTEGRACARDPME) 
        REFERENCES INTEGRACARDPME (NRINTEGRACARDPME)
/

CREATE INDEX PME00095_FK ON GRUPSERV(NRINTEGRACARDPME)
/

ALTER TABLE TIPOCARD ADD NRINTEGRACARDPME NUMBER
/
ALTER TABLE TIPOCARD ADD 
    CONSTRAINT FKPME00096INTEGRACARDPME FOREIGN KEY (NRINTEGRACARDPME) 
        REFERENCES INTEGRACARDPME (NRINTEGRACARDPME)
/

CREATE INDEX PME00096_FK ON TIPOCARD(NRINTEGRACARDPME)
/

ALTER TABLE SERVICO ADD NRINTEGRACARDPME NUMBER
/
ALTER TABLE SERVICO ADD 
    CONSTRAINT FKPME00097INTEGRACARDPME FOREIGN KEY (NRINTEGRACARDPME) 
        REFERENCES INTEGRACARDPME (NRINTEGRACARDPME)
/

CREATE INDEX PME00097_FK ON SERVICO(NRINTEGRACARDPME)
/

ALTER TABLE ROTATRANS ADD NRINTEGRACARDPME NUMBER
/
ALTER TABLE ROTATRANS ADD 
    CONSTRAINT FKPME00098INTEGRACARDPME FOREIGN KEY (NRINTEGRACARDPME) 
        REFERENCES INTEGRACARDPME (NRINTEGRACARDPME)
/

CREATE INDEX PME00098_FK ON ROTATRANS(NRINTEGRACARDPME)
/

ALTER TABLE FILIAL ADD NRCONTINTPME NUMBER
/

ALTER TABLE PRATO ADD CDPRATEXTPME NUMBER
/