CREATE TABLE TPOPERCARDCONS
(
   CDTPOPERACAO 		VARCHAR2(1)		NOT NULL,
   NMTPOPERACAO 	VARCHAR2(10),
   NRORG                       	NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO                    	VARCHAR2(1)     		DEFAULT 'S' NOT NULL
	CONSTRAINT CKC_IDATIVO_TPOPERCARDCONS CHECK (IDATIVO IN ('S','N')),
   DTINCLUSAO             	DATE                   		NULL,
   DTULTATU                 	DATE                  		NULL,
   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 PK_TPOPERACAO PRIMARY KEY (CDTPOPERACAO)
)
/
CREATE TABLE LOGCREDCONSUMIDOR
(
  CDCLIENTE 		VARCHAR2(21)		NOT NULL,
  CDCONSUMIDOR 		VARCHAR2(21)		NOT NULL,
  CDTPOPERACAO 		VARCHAR2(1)		NOT NULL,
  DSLOGCREDCONS 	VARCHAR2(200),
  DTOPERACAO 		DATE,
   NRORG                       	NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO                    	VARCHAR2(1)     		DEFAULT 'S' NOT NULL
	CONSTRAINT CKC_IDATIVO_LOGCREDCONSU CHECK (IDATIVO IN ('S','N')),
   DTINCLUSAO             	DATE                   		NULL,
   DTULTATU                 	DATE                  		NULL,
   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_CDTPOPERAC_LOGCRED CHECK (CDTPOPERACAO IN ('1','2'))	
)
/
CREATE INDEX VND00748_FK ON  LOGCREDCONSUMIDOR (CDTPOPERACAO ASC)
/
ALTER TABLE LOGCREDCONSUMIDOR ADD
	CONSTRAINT FKVND00748TPOPERCARDCONS  FOREIGN KEY (CDTPOPERACAO)
		REFERENCES TPOPERCARDCONS (CDTPOPERACAO)
/
ALTER TABLE INTEGRACAO ADD CDPLATAFORMAVEND VARCHAR2(3)