CREATE TABLE PREVVNDPRODHR (
    NRSEQPREVPDV 	VARCHAR2(10) 	NOT NULL,
    CDFILIAL 		VARCHAR2(4) 	NOT NULL, 
    CDLOJA 			VARCHAR2(10) 	NOT NULL,
    CDPRODUTO 		VARCHAR2(10) 	NOT NULL,
    NRDIASEMANA 	VARCHAR2(3),
    NRSEMANA 		VARCHAR2(3) 	NOT NULL,
    HORA 			VARCHAR2(2) 	NOT NULL,
    DTPRODCONPDV 	DATE NOT NULL,
    QTCUPONS 		VARCHAR2(10) 	NOT NULL,
    MTC 			FLOAT(126) 		NOT NULL,
    QTCONSUMO 		FLOAT(126) 		NOT NULL,
    NRORG 			NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx', 'nrorg') NOT NULL,
    IDATIVO 		VARCHAR2(1) 	DEFAULT 'S' NOT NULL 
		CONSTRAINT CKC_IDATIVO_PREVVNDPRODHR CHECK (IDATIVO IN ('S','N')),
    DTINCLUSAO 		DATE 			NULL,
    DTULTATU 		DATE 			NULL,
	NRORGINCLUSAO   NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg'),
    NURGULTATU 		NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg'),
    CDOPERULTATU 	VARCHAR2(12) 	DEFAULT '1',
		PRIMARY KEY (NRSEQPREVPDV, CDFILIAL, CDLOJA, CDPRODUTO, DTPRODCONPDV, HORA)
)
/