CREATE TABLE MENSTIPOOPER
(
  NRMENSTPOPER 		VARCHAR2(10)    NOT NULL,
  CDMENSAGEM   		VARCHAR2(03)    NOT NULL,
  CDTIPOOPER   		VARCHAR2(02)    NOT NULL,
  IDENTRSAIDOP 		VARCHAR2(01)    NOT NULL,
  DSMENSAGEM   		VARCHAR2(120)   NOT NULL,
		CONSTRAINT PK_MENSTIPOOPER  PRIMARY KEY (NRMENSTPOPER, CDTIPOOPER, IDENTRSAIDOP),
  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_MENSTIPOOPER CHECK (IDATIVO IN ('S','N'))
)
/
ALTER TABLE MENSTIPOOPER
    ADD CONSTRAINT FKFIS00868MENSTIPOOPER FOREIGN KEY  (CDTIPOOPER, IDENTRSAIDOP)
       REFERENCES TIPOOPERAC (CDTIPOOPER, IDENTRSAIDOP)
/

CREATE INDEX FKFIS00868_FK ON MENSTIPOOPER (CDTIPOOPER,IDENTRSAIDOP ASC)
/

ALTER TABLE TIPOOPERAC ADD IDCONSLISPRECO VARCHAR2(01) DEFAULT 'N'
/
ALTER TABLE ITEMCOLE ADD VRPRECOVNDORDEM FLOAT
/