CREATE TABLE HISTCUSTOPRODMAM (
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDCIA VARCHAR2(4) NOT NULL, 
  CDMANCIA VARCHAR2(4) NOT NULL, 
  NRSERVICOCIAFILI NUMBER(10) NOT NULL, 
  CDCLASSE VARCHAR2(4) NOT NULL, 
  CDSUBGRU VARCHAR2(10) NOT NULL, 
  NRSEQSUBGRUSEMAM NUMBER(10) NOT NULL, 
  CDCICLO VARCHAR2(4) NOT NULL, 
  NRSEQHISTCUSTOPRODMAM NUMBER(10) NOT NULL, 
  CDPRODUTO VARCHAR2(10) NOT NULL, 
  VRCUSPRSUBSEMAM DOUBLE PRECISION NOT NULL, 
  DTCUSTO DATE DEFAULT NULL NULL, 
  IDTIPOCUSTO VARCHAR2(1) DEFAULT NULL 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 NUMBER(10) DEFAULT 1 NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL
)