ALTER TABLE ITEMPROIMPOS DROP CONSTRAINT CKC_IDMOTDESONERAIT
/
ALTER TABLE ITEMPROIMPOS ADD CONSTRAINT CKC_IDMOTDESONERAIT CHECK (IDMOTDESONERAIT IN ('1','2','3','4','5','6','7','8','9','10','11','12','16'))
/
ALTER TABLE ITEMPROIMPOS ADD CDCEST VARCHAR2(09) NULL
/
ALTER TABLE ITEMPROIMPOS ADD VRBASECALCDEST FLOAT
/
ALTER TABLE ITEMPROIMPOS ADD VRALIQINTEDEST FLOAT
/
ALTER TABLE ITEMPROIMPOS ADD VRPERCPARTILHA FLOAT
/
ALTER TABLE ITEMPROIMPOS ADD VRIMPOPARTDEST FLOAT
/
ALTER TABLE ITEMPROIMPOS ADD VRIMPOPARTREME FLOAT
/
ALTER TABLE ITEMPROIMPOSORIG DROP CONSTRAINT CKC_IDMOTDESONERAITO
/
ALTER TABLE ITEMPROIMPOSORIG ADD CONSTRAINT CKC_IDMOTDESONERAITO CHECK (IDMOTDESONERAIT IN ('1','2','3','4','5','6','7','8','9','10','11','12','16'))
/
ALTER TABLE ITEMPROIMPOSORIG ADD CDCEST VARCHAR2(09) NULL
/
ALTER TABLE DADOSFISCREGRA ADD CDCEST VARCHAR2(09) NULL
/
ALTER TABLE DADOSFISCNCM ADD CDCEST VARCHAR2(09) NULL
/
ALTER TABLE DADOSFISCPROD ADD CDCEST VARCHAR2(09) NULL
/
ALTER TABLE INCIDENCIA ADD CDCEST VARCHAR2(09) NULL
/
ALTER TABLE INCITEMP ADD CDCEST VARCHAR2(09) NULL
/
CREATE TABLE SEGMERCABENS
(
   CDSEGMENTO       VARCHAR2(02)    NOT NULL,
   DSSEGMENTO       VARCHAR2(255)   NOT NULL,
   NRORG            NUMBER          DEFAULT 1 NOT NULL,
   IDATIVO          VARCHAR2(1)     DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_SEGMERCABENS CHECK (IDATIVO IN ('S','N')),
   DTINCLUSAO       DATE            NULL,
   DTULTATU         DATE            NULL,
   NRORGINCLUSAO    NUMBER          DEFAULT 1 NULL,
   CDOPERINCLUSAO   VARCHAR2(12)    DEFAULT '1' NULL,
   NRORGULTATU      NUMBER          DEFAULT 1 NULL,
   CDOPERULTATU     VARCHAR2(12)    DEFAULT '1',
      CONSTRAINT PK_SEGMERCABENS PRIMARY KEY (CDSEGMENTO)
)