ALTER TABLE TMPCOMESPPRATPME ADD NRCARDIAPMEDEST VARCHAR(20)
/

ALTER TABLE TMPCOMESPPRATPME ADD NRCARDIAPMEORI VARCHAR(20)
/

ALTER TABLE TMPCOMESPPRATPME ADD NRSEQPRACPME_REF NUMBER
/

CREATE TABLE LOGREACOMESPPRATPME (
    CDFILCENTPME     	VARCHAR2(4)  NOT NULL,
    DTPROC              DATE          NOT NULL,
    CDFILIAL         	VARCHAR2(4)  NOT NULL,
    CDTIPOCARD          VARCHAR2(10) NOT NULL,
    NRCARDPME         	VARCHAR2(10) NOT NULL,
    CDSERVFILI          VARCHAR2(5)  NOT NULL,
    DTCARDIAPME         DATE          NOT NULL,
    NRCARDIAPMEORI      VARCHAR2(10) NOT NULL,
    CDTIPOPRATORI     	VARCHAR2(2)  NOT NULL,
    CDPRATOORI          VARCHAR2(10) NOT NULL,
    CDFILAUXPRATORI     VARCHAR2(4)  NOT NULL,
    NRSEQCONFORI     	VARCHAR2(3)  NOT NULL,
    NRCARDIAPMEDEST  	VARCHAR2(10) NOT NULL,
    CDTIPOPRATDEST      VARCHAR2(2)  NOT NULL,
    CDPRATODEST         VARCHAR2(10) NOT NULL,
    CDFILAUXPRATDEST 	VARCHAR2(4)  NOT NULL,
    NRSEQCONFDEST     	VARCHAR2(3)  NOT NULL, 
    QTCOMENSAISDEST     NUMBER          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_LOGREACOMESPRATPME CHECK (IDATIVO IN ('S','N'))
)
/