CREATE TABLE PEDIDOCOLETA_TMP (
    NRPEDIDOCOLETA    NUMBER,
    NRPEDCOL          NUMBER,
    CDREGIAO          VARCHAR2(03), 
    CDOPERADOR        VARCHAR2(12), 
    CDFORNECED        VARCHAR2(21),  
    CDPRODUTO         VARCHAR2(10), 
    CDMARCA           VARCHAR2(05), 
    CDMARCAPADR       VARCHAR2(05), 
    QTACOMPRAR        FLOAT(126),
    NRCOLEPRECO       VARCHAR2(10),
    NRSEQPRELIST      VARCHAR2(10),
    CDLEILAO          VARCHAR2(10),
    CDOPERLANC        VARCHAR2(12),
    CDFILIAL       	  VARCHAR2(4),
    NRCOMPRA       	  VARCHAR2(10),
    CDPRODINI      	  VARCHAR2(20),
    CDPRODFIN      	  VARCHAR2(20),
    DTPERIODOINI   	  DATE,
    DTPERIODOFIM   	  DATE,
    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_PEDIDOCOLETA_TMP CHECK (IDATIVO IN ('S','N')),
      CONSTRAINT PK_PEDIDOCOLETA_TMP PRIMARY KEY (NRPEDIDOCOLETA)
)
/

CREATE SEQUENCE SEQ_PEDCOLTMP_NRPEDIDOCOLETA INCREMENT BY 1 MINVALUE 1
/

CREATE SEQUENCE SEQ_PEDCOLTMP_NRPEDCOL INCREMENT BY 1 MINVALUE 1
/