ALTER TABLE TIPOOPERREMRET ADD NRORG NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL
/

ALTER TABLE TIPOOPERREMRET ADD IDATIVO VARCHAR2(1) DEFAULT 'S'	NOT NULL
/

ALTER TABLE TIPOOPERREMRET ADD DTINCLUSAO DATE DEFAULT SYSDATE
/

ALTER TABLE TIPOOPERREMRET ADD DTULTATU DATE DEFAULT SYSDATE
/

ALTER TABLE TIPOOPERREMRET ADD NRORGINCLUSAO NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NULL
/

ALTER TABLE TIPOOPERREMRET ADD CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL
/

ALTER TABLE TIPOOPERREMRET ADD NRORGULTATU NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NULL
/

ALTER TABLE TIPOOPERREMRET ADD CDOPERULTATU VARCHAR2(12) DEFAULT '1'
/

ALTER TABLE TIPOOPERREMRET ADD CONSTRAINT CKC_IDATIVO_TIPOOPERREMRET CHECK (IDATIVO IN ('S','N'))
/

ALTER TABLE TIPOOPERREMRET DROP CONSTRAINT FK_TIPOOPERREMRET
/

ALTER TABLE TIPOOPERREMRET ADD CONSTRAINT FKFIS00863TIPOOPERREMRET  FOREIGN KEY  (CDTIPOOPER, IDENTRSAIDOP)
       REFERENCES TIPOOPERAC (CDTIPOOPER, IDENTRSAIDOP)
/

CREATE INDEX FIS00863_FK ON TIPOOPERREMRET (CDTIPOOPER ASC, IDENTRSAIDOP ASC)
/