ALTER TABLE VARIACAOREC ADD (
  NROPCOES DOUBLE PRECISION DEFAULT NULL NULL
)
/
ALTER TABLE PRORECEITAM ADD (
  IDPREFERENCIA VARCHAR2(1) DEFAULT 'N' NOT NULL
)
/
ALTER TABLE PRORECEITAM ADD CONSTRAINT CKC_IDPREFERENCIA_PRORECEITAM CHECK (IDPREFERENCIA IN ('S','N'))
/
ALTER TABLE SUBRECEITAM ADD (
  IDPREFERENCIA VARCHAR2(1) DEFAULT 'N' NOT NULL
)
/
ALTER TABLE SUBRECEITAM ADD CONSTRAINT CKC_IDPREFERENCIA_SUBRECEITAM CHECK (IDPREFERENCIA IN ('S','N'))
/
CREATE TABLE UTILRECFLEX (
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDRECEITA VARCHAR2(10) NOT NULL, 
  NRSEQUTILRECFLEX NUMBER(10) NOT NULL, 
  DTINIVIGENCIA DATE NOT NULL, 
  DTFIMVIGENCIA DATE NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO VARCHAR2(255) DEFAULT '1' NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_UTILRECFLEX PRIMARY KEY(CDFILIAL, CDRECEITA, NRSEQUTILRECFLEX, NRORG)
)
/
ALTER TABLE UTILRECFLEX ADD CONSTRAINT CKC_IDATIVO_UTILRECFLEX CHECK (IDATIVO IN ('S','N'))