CREATE TABLE TMP_ITEMAUTFDEL (
    NRITEMAUTFDEL     NUMBER       NOT NULL,
    CDFILDEST         VARCHAR2(4)  NOT NULL,
    CDFILLANC         VARCHAR2(4)  NOT NULL,
    NRAUTOFORN        VARCHAR2(10) NOT NULL,
    CDMARCA           VARCHAR2(5)  NOT NULL,
    CDPRODUTO         VARCHAR2(10) NOT NULL,
    DTPROGENTAF       DATE         NOT NULL,
    QTPROGENTAF       FLOAT(126)   NOT NULL,
    VRPREUNIAF        FLOAT(126)   NOT NULL,
    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_TMP_ITEMAUTFDEL CHECK (IDATIVO IN ('S','N')),
        CONSTRAINT PK_TMPITEMAUTFDEL PRIMARY KEY (NRITEMAUTFDEL),
        CONSTRAINT UN_TMPITEMAUTFDEL UNIQUE (CDFILDEST, CDFILLANC, NRAUTOFORN, CDMARCA, CDPRODUTO, DTPROGENTAF)
)
/

