CREATE TABLE ITFREQPRATMES (
  NRITFREQPRATMES NUMBER(10) NOT NULL, 
  NRFREQPRATMES NUMBER(10) NOT NULL, 
  CDFILAUXPRAT VARCHAR2(4) NOT NULL, 
  CDPRATO VARCHAR2(10) NOT NULL, 
  NRMINFREQPRATMES NUMBER(10) NOT NULL, 
  NRMAXFREQPRATMES NUMBER(10) NOT NULL, 
  NRMAXFREQPRATSEM NUMBER(10) NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_ITFREQPRATMES PRIMARY KEY(NRITFREQPRATMES, NRORG)
)
/
ALTER TABLE ITFREQPRATMES ADD CONSTRAINT FKPLA00948FREQPRATMES FOREIGN KEY (NRFREQPRATMES, NRORG) REFERENCES FREQPRATMES (NRFREQPRATMES, NRORG)
/
ALTER TABLE ITFREQPRATMES ADD CONSTRAINT CKC_IDATIVO_ITFREQPRATMES CHECK (IDATIVO IN ('S','N'))
/
CREATE INDEX FKPLA00948FREQPRATMES ON ITFREQPRATMES (NRFREQPRATMES, NRORG)