CREATE TABLE RELACITEMNFOP(
  NRSEQRELAC        VARCHAR2(10)    NOT NULL,
  CDFILIAL          VARCHAR2(04)    NOT NULL,
  NRORDPROD         VARCHAR2(10)    NOT NULL,
  NRSUBORDPROD      VARCHAR2(10)    NOT NULL,
  CDPRODINSUMO      VARCHAR2(10)    NOT NULL,
  NRLOTEESTQ        VARCHAR2(20)    NULL,
  NRSUBLOTE         VARCHAR2(04)    NULL,
  QTRETIRADA        FLOAT           NULL,
  NRLANCTONF        VARCHAR2(10)    NOT NULL,
  NRPEDIDO          VARCHAR2(10)    NOT NULL,
  NRITEMPED         VARCHAR2(10)    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_RELACITEMNFOP CHECK (IDATIVO IN ('S','N')),
        CONSTRAINT PK_RELACITEMNFOP PRIMARY KEY (CDFILIAL, NRSEQRELAC)
)
/