CREATE TABLE PERCCORRECAOGOP (
  NRPERCCORRECAOGOP NUMBER(10) NOT NULL, 
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDANO NUMBER(10) NOT NULL, 
  VRMES01 DOUBLE PRECISION NOT NULL, 
  VRMES02 DOUBLE PRECISION NOT NULL, 
  VRMES03 DOUBLE PRECISION NOT NULL, 
  VRMES04 DOUBLE PRECISION NOT NULL, 
  VRMES05 DOUBLE PRECISION NOT NULL, 
  VRMES06 DOUBLE PRECISION NOT NULL, 
  VRMES07 DOUBLE PRECISION NOT NULL, 
  VRMES08 DOUBLE PRECISION NOT NULL, 
  VRMES09 DOUBLE PRECISION NOT NULL, 
  VRMES10 DOUBLE PRECISION NOT NULL, 
  VRMES11 DOUBLE PRECISION NOT NULL, 
  VRMES12 DOUBLE PRECISION NOT NULL, 
  IDTIPOORCAOP VARCHAR2(30) DEFAULT 'FATURAMENTO' 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_PERCCORRECAOGOP PRIMARY KEY(NRPERCCORRECAOGOP)
)
/
ALTER TABLE PERCCORRECAOGOP ADD CONSTRAINT CKC_ITEMORCAGOP_PERCCORRECAO CHECK (IDTIPOORCAOP IN ('FATURAMENTO', 'CONSUMO', 'MAOOBRA', 'DESPMATRIZ', 'DESPDIVERSA', 'DESPENTRADA', 'LIQUIDO', 'IMPOSTO', 'IMPOSTOARECUPERAR', 'IMPOSTOSOBLUCRO', 'INVESTIMENTO', 'DEPRECIACAO'))
/
ALTER TABLE PERCCORRECAOGOP ADD CONSTRAINT CKC_IDATIVO_PERCCORRECAOGOP CHECK (IDATIVO IN ('S','N'))