ALTER TABLE NOTAFISCAL ADD IDNFDRASTRSNCM VARCHAR2(03) DEFAULT 'NAO' NOT NULL
        CONSTRAINT CKC_IDNFDRASTRSNCM_NOTAFISCAL CHECK (IDNFDRASTRSNCM IN ('SIM','NAO'))
/

ALTER TABLE NOTAFISCAL ADD  IDSTATUSSEPSNCM VARCHAR2(03) DEFAULT 'N' NOT NULL
        CONSTRAINT CKC_IDSTATUSSEPSNCM_NOTAFISCAL CHECK (IDSTATUSSEPSNCM IN ('S','N'))
/

ALTER TABLE ITEMPRODUTO ADD IDSTATUSSEPSNCM VARCHAR2(01) DEFAULT 'N' NOT NULL
/

ALTER TABLE ITEMPRODUTO ADD CONSTRAINT CKC_ITEMPROD_IDSTATUSSEPSNCM CHECK (IDSTATUSSEPSNCM IN ('N', 'S'))
/

CREATE TABLE IUMITEMPROD
(
   CDFILIAL 		 VARCHAR2(4) NOT NULL,
   NRLANCTONF 		 VARCHAR2(10) NOT NULL,
   NRSEQITPROD 		 VARCHAR2(4) NOT NULL,
   CDIUMPROD 		 VARCHAR2(100) NOT NULL,
   CDPRODUTO 	 	 VARCHAR2(10) NOT NULL,
   CDALMOXARIFE 	 VARCHAR2(6) NULL ,
   CDLOCALESTOQ 	 VARCHAR2(6) NULL ,
   NRLOTEESTQ 		 VARCHAR2(20) NULL ,
   NRSUBLOTE 		 VARCHAR2(4) NULL ,
   QTRESPRODPED 	 FLOAT NULL ,
   IDSTATUSRESER 	 VARCHAR2(02) NULL,
   NRORG             NUMBER 	     DEFAULT         SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO           VARCHAR2(1)     DEFAULT 'S' NOT NULL
		CONSTRAINT CKC_IDATIVO_IUMITEMPROD CHECK (IDATIVO IN ('S','N')),
   DTINCLUSAO        DATE                  			NULL,
   DTULTATU          DATE                  			NULL,
   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 PK_IUMITEMPROD PRIMARY KEY (CDFILIAL, NRLANCTONF, NRSEQITPROD, CDPRODUTO,CDIUMPROD)
)
/