CREATE TABLE TMP_DUPLICACOTACAO (
    NRITEMDUPLICA 	  NUMBER NOT NULL, 
    NRDUPLICA     	  NUMBER NOT NULL, 
    CDFILIAL      	  VARCHAR2(4),     
    NRCOLEORIGIC  	  VARCHAR2(10), 
    CDOPERADOR    	  VARCHAR2(12),
    CDFORNECED    	  VARCHAR2(21),   
    CDREGIAO      	  VARCHAR2(3),
    CDPRODUTO     	  VARCHAR2(10),    
    CDMARCA       	  VARCHAR2(5),
    CDTIPCOB      	  VARCHAR2(2),     
    CDSEGMARCCOL  	  VARCHAR2(5),
    DTINIVALORIG  	  DATE,  
    DTFINVALORIG  	  DATE,
    VRPRECUNIITM  	  FLOAT, 
    VRPRECECOITM  	  FLOAT,
    VRPERDESITM   	  FLOAT,    
    IDTIPFREITM   	  VARCHAR2(1),
    NRPZOENTCOL   	  VARCHAR2(3),  
    DSPZOPGTCONC  	  VARCHAR2(1000),
    CDOPERINCL    	  VARCHAR2(12),
    IDPRECALT     	  VARCHAR2(1),    
    DTINCLITMCOL  	  DATE, 
    IDSITUCOLETA  	  VARCHAR2(1), 
    IDSITUCADA    	  VARCHAR2(1), 
    IDULTIDTVALQ  	  VARCHAR2(1), 
    IDMARSEMQUA   	  VARCHAR2(1),
    IDFORNAUTO    	  VARCHAR2(1),
    CDQUALIF      	  VARCHAR2(2),
    DTVALQUALIF   	  DATE,
    CDARVPROD     	  VARCHAR2(20),
    DTINIVALNEW   	  DATE,
    DTFINVALNEW   	  DATE,
    IDDISMONTLIS  	  VARCHAR2(1),
    DSERROR       	  VARCHAR2(50),   
	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_TMPDUPLICACOTACAO CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_TMPDUPLICACOTACAO PRIMARY KEY (NRITEMDUPLICA)
)
/

CREATE SEQUENCE SEQ_ITEMDUPLICACOT INCREMENT BY 1 START WITH 1
/

CREATE SEQUENCE SEQ_DUPLICACOTACAO INCREMENT BY 1 START WITH 1
/

ALTER TABLE COLETAPR ADD NRDUPLICA NUMBER
/

ALTER TABLE ITEMCOLE ADD NRDUPLICA NUMBER
/

ALTER TABLE LOGITEMCOLE ADD NRDUPLICA NUMBER
/