CREATE TABLE ERROLIQUIDACAO(
    CDFILIAL       	  VARCHAR2(04) 	  NOT NULL,
    NRPEDIDO       	  VARCHAR2(10) 	  NOT NULL,
    NRITEMPED      	  VARCHAR2(10) 	  NULL,
    NRSEQERROITEM  	  VARCHAR2(10) 	  NOT NULL,
    CDPRODUTO      	  VARCHAR2(10) 	  NULL,
    DSERRO         	  VARCHAR2(50) 	  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_ERROLIQUIDACAO CHECK (IDATIVO IN ('S','N')),
        CONSTRAINT PK_ERROLIQUIDACAO PRIMARY KEY (CDFILIAL, NRPEDIDO, NRSEQERROITEM)
)
/