CREATE TABLE CODRECEITAEST (
  NRSEQCODRECEEST NUMBER(10) NOT NULL, 
  CDPAIS VARCHAR2(4) DEFAULT '0055' NOT NULL, 
  SGESTADO VARCHAR2(2) NOT NULL, 
  CDRECEITAEST VARCHAR2(20) NOT NULL, 
  NMRECEITAEST VARCHAR2(500) NOT NULL, 
  DTINIVALID DATE NOT NULL, 
  DTFIMVALID DATE NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 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_CODRECEITAEST PRIMARY KEY(NRSEQCODRECEEST, NRORG)
)
/
ALTER TABLE CODRECEITAEST ADD CONSTRAINT FKFIS00673ESTADO FOREIGN KEY (CDPAIS, SGESTADO, NRORG) REFERENCES ESTADO (CDPAIS, SGESTADO, NRORG)
/
ALTER TABLE CODAJUSTEEFDICMS ADD (
  IDTPCODRECEITA VARCHAR2(1) DEFAULT 'E' NULL
)
/
ALTER TABLE CODAJUSTEEFDICMS MODIFY (
  CDPAIS VARCHAR2(4) DEFAULT '0055'  ' NULL, 
  SGESTADO VARCHAR2(2) DEFAULT NULL NULL
)