CREATE TABLE DEDURECEITAROP (
  NRDEDURECEITAROP NUMBER(10) NOT NULL, 
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDTIPOOPER VARCHAR2(2) NOT NULL, 
  IDENTRSAIDOP VARCHAR2(1) NOT NULL, 
  NRORG NUMBER(10) DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_DEDURECEITAROP PRIMARY KEY(NRDEDURECEITAROP)
)
/
ALTER TABLE DEDURECEITAROP ADD CONSTRAINT CKC_IDENTRSAIDOP_DEDURECEITA CHECK (IDENTRSAIDOP IN ('E','S'))
/
ALTER TABLE DEDURECEITAROP ADD CONSTRAINT CKC_IDATIVO_DEDURECEITAROP CHECK (IDATIVO IN ('S','N'))
/
ALTER TABLE DEDURECEITAROP ADD CONSTRAINT FKGOP00698TIPOOPERAC FOREIGN KEY (CDTIPOOPER, IDENTRSAIDOP) REFERENCES TIPOOPERAC (CDTIPOOPER, IDENTRSAIDOP)
/
CREATE INDEX FKGOP00698TIPOOPERAC ON DEDURECEITAROP (CDTIPOOPER, IDENTRSAIDOP)