CREATE TABLE PREVPAXCALCCLAPRODM (
  CDFILIAL VARCHAR2(4) NOT NULL, 
  NRPREVISAOPROD NUMBER(10) NOT NULL, 
  NRCALCCLAPROD NUMBER(10) NOT NULL, 
  CDCIA VARCHAR2(4) NOT NULL, 
  NRVOO VARCHAR2(5) NOT NULL, 
  CDTRECHO VARCHAR2(4) NOT NULL, 
  CDCLASSE VARCHAR2(4) NOT NULL, 
  QTPAX VARCHAR2(4) NOT NULL, 
  IDCOMPLEMENTAR VARCHAR2(1) DEFAULT 'N' 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_PREVPAXCALCCLAPRODM PRIMARY KEY(CDFILIAL, NRPREVISAOPROD, NRCALCCLAPROD, NRORG)
)
/
ALTER TABLE PREVPAXCALCCLAPRODM ADD CONSTRAINT CKC_IDCOMPLEMENTAR_PVPXCALCCLA CHECK (IDCOMPLEMENTAR IN ('S','N'))
/
ALTER TABLE PREVPAXCALCCLAPRODM ADD CONSTRAINT CKC_IDATIVO_PREVPAXCALCCLAM CHECK (IDATIVO IN ('S','N'))