CREATE TABLE LOGINTCARDAMES(
	NRLOGINTCARDAMES	NUMBER 														NOT NULL,
	DTLOGINT         	DATE 														NOT NULL,
	CDFILIAL         	VARCHAR2(4) 												NULL,
	CDSERVFILI       	VARCHAR2(5) 												NULL,
	DTMESCARD        	DATE 														NULL,
	CDOPERADOR       	VARCHAR2(12) 												NULL,
	DSARQIMPORT      	CLOB 														NULL,
	NRORG 				NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
	IDATIVO 			VARCHAR2(1) 	DEFAULT 'S' 								NOT NULL
		CONSTRAINT CKC_IDATIVO_LOGINTCARDAMES 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'									NULL,
	CONSTRAINT PK_LOGINTCARDAMES PRIMARY KEY (NRLOGINTCARDAMES)
)
/
CREATE TABLE LOGINTCARDADIA(
	NRLOGINTCARDADIA	NUMBER 														NOT NULL,
	NRLOGINTCARDAMES 	NUMBER 														NOT NULL,
	DTCARDAPIO       	DATE 														NULL,
	QTCOMESTICAR     	FLOAT 														NULL,
	NRORG 				NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
	IDATIVO 			VARCHAR2(1) 	DEFAULT 'S' 								NOT NULL
		CONSTRAINT CKC_IDATIVO_LOGINTCARDADIA 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' 								NULL,
	CONSTRAINT PK_LOGINTCARDADIA PRIMARY KEY (NRLOGINTCARDADIA),
	CONSTRAINT FKPLA01137LOGINTCARDAMES FOREIGN KEY (NRLOGINTCARDAMES)
		REFERENCES LOGINTCARDAMES (NRLOGINTCARDAMES)
)
/
CREATE INDEX FKPLA01137LOGINTCARDAMES ON LOGINTCARDADIA (NRLOGINTCARDAMES ASC)
/
CREATE TABLE LOGINTCOMPCARD(
	NRLOGINTCOMPCARD	NUMBER 														NOT NULL,
	NRLOGINTCARDAMES  	NUMBER 														NOT NULL,
	NRLOGINTCARDADIA  	NUMBER 														NOT NULL,
	CDFILAUXPRAT      	VARCHAR2(4) 												NULL,
	CDPRATO           	VARCHAR2(10) 												NULL,
	NRSEQPRATCAR      	NUMBER(3) 													NULL,
	CDTIPOPRAT        	VARCHAR(2) 													NULL,
	VRPECONSCARD     	FLOAT 														NULL,
	NRORG 				NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
	IDATIVO 			VARCHAR2(1) 	DEFAULT 'S' 								NOT NULL
		CONSTRAINT CKC_IDATIVO_LOGINTCOMPCARD 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'									NULL,
	CONSTRAINT PK_LOGINTCOMPCARD PRIMARY KEY (NRLOGINTCOMPCARD),
	CONSTRAINT FKPLA01138LOGINTCARDAMES FOREIGN KEY (NRLOGINTCARDAMES)
		REFERENCES LOGINTCARDAMES (NRLOGINTCARDAMES),
	CONSTRAINT FKPLA01139LOGINTCARDADIA FOREIGN KEY (NRLOGINTCARDADIA)
		REFERENCES LOGINTCARDADIA (NRLOGINTCARDADIA)
)
/
CREATE INDEX FKPLA01138LOGINTCARDAMES ON LOGINTCOMPCARD (NRLOGINTCARDAMES)
/
CREATE INDEX FKPLA01139LOGINTCARDADIA ON LOGINTCOMPCARD (NRLOGINTCARDADIA)
/
CREATE TABLE LOGINTCARDAPIO(
	NRLOGINTCARDAPIO	NUMBER 														NOT NULL,
	NRLOGINTCARDAMES 	NUMBER 														NOT NULL,
	DTCARDAPIO       	DATE 														NULL,
	CDTIPOPRAT       	VARCHAR2(2) 												NULL,
	CDPRATO          	VARCHAR2(10) 												NULL,
	CDFILAUXPRAT     	VARCHAR2(4) 												NULL,
	NRSEQPRAT        	NUMBER(3) 													NULL,
	VRPECONSCARD     	FLOAT 														NULL,
	QTCOMESTICAR     	FLOAT 														NULL,
	NRORG 				NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
	IDATIVO 			VARCHAR2(1) 	DEFAULT 'S' 								NOT NULL
		CONSTRAINT CKC_IDATIVO_LOGINTCARDAPIO 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'									NULL,
	CONSTRAINT PK_LOGINTCARDAPIO PRIMARY KEY (NRLOGINTCARDAPIO, NRLOGINTCARDAMES),
	CONSTRAINT FKPLA01140LOGINTCARDAMES FOREIGN KEY (NRLOGINTCARDAMES)
		REFERENCES LOGINTCARDAMES (NRLOGINTCARDAMES)
)
/
CREATE INDEX FKPLA01140LOGINTCARDAMES ON LOGINTCARDAPIO (NRLOGINTCARDAMES)
/
CREATE TABLE LOGINTCARDWS (
	NRLOGINTCARDWS		NUMBER														NOT NULL,
	NRLOGINTCARDAMES 	NUMBER 														NOT NULL,
	DSITEM           	VARCHAR2(250) 												NULL,
	DSERRO           	VARCHAR2(250) 												NULL,
	CDOPERADOR       	VARCHAR2(12) 												NULL,
	NRORG 				NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
	IDATIVO 			VARCHAR2(1) 	DEFAULT 'S' 								NOT NULL
		CONSTRAINT CKC_IDATIVO_LOGINTCARDWS 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'									NULL,
	CONSTRAINT PK_LOGINTCARDWS PRIMARY KEY (NRLOGINTCARDWS),
	CONSTRAINT FKPLA01141LOGINTCARDAMES FOREIGN KEY (NRLOGINTCARDAMES)
		REFERENCES LOGINTCARDAMES (NRLOGINTCARDAMES)
)
/
CREATE INDEX FKPLA01141LOGINTCARDAMES ON LOGINTCARDWS (NRLOGINTCARDAMES)