-- Create table
create table adam.FCO_INTEGRADA_RT04
(
  COMPANIA            CHAR(4) not null,
  ANIO                NUMBER not null,
  MES                 NUMBER not null,
  SUCURSAL            VARCHAR2(10) not null,
  TIPO_PLANILLA       CHAR(1) not null,
  COD_EPS             CHAR(10) not null,
  SECUENCIA           NUMBER not null,
  NIT                 varchar2(16) not null,
  DV                  CHAR(1) not null,
  SUMA_APORTES        NUMBER(10) not null,
  SUMA_UPC            NUMBER(10) not null,
  NRO_AUT_IGE         VARCHAR2(15) not null,
  SUMA_AUT_IGE        NUMBER(10) not null,
  NRO_AUT_LMA         VARCHAR2(15) not null,
  SUMA_AUT_LMA        NUMBER(10) not null,
  NETO_APORTES        NUMBER,
  DIAS_MORA           NUMBER not null,
  INT_MORA_APORTES    NUMBER(10) not null,
  INT_MORA_UPC        NUMBER(10) not null,
  SUBTOTAL_APORTES    NUMBER,
  SUBTOTAL_UPC        NUMBER,
  NRO_RADICACION      VARCHAR2(10) not null,
  SALDO_FAVOR_APORTES NUMBER(10) not null,
  SALDO_FAVOR_UPC     NUMBER(10) not null,
  TOTAL_APORTES       NUMBER,
  TOTAL_UPC           NUMBER,
  TOTAL_PAGAR         NUMBER,
  FOSYGA              NUMBER(10) not null,
  TOTAL_AFILIADOS     NUMBER(6) not null,
  ORIGEN              NUMBER(1) null
)
tablespace TS_ADAMDATOS
;
-- Create/Recreate primary, unique and foreign key constraints 
alter table adam.FCO_INTEGRADA_RT04
  add constraint PK_FCO_INTEGRADA_RT04 primary key (COMPANIA,ANIO,MES,SUCURSAL,TIPO_PLANILLA,COD_EPS)
  using index 
  tablespace TS_ADAMINDICES
;
-- Grant/Revoke object privileges 
