-- Create table
create table adam.fco_pi_pens_rt1
(
    compania char(4) NOT NULL,
    anio number NOT NULL,
    mes number NOT NULL,
    sucursal varchar2(10) NOT NULL,
    secuencia number NOT NULL,
    razon_social varchar2(200) NOT NULL,
    tipo_documento char(2) NOT NULL,
    nro_id varchar2(16) NOT NULL,
    dv char(1) NOT NULL,
    forma_presentacion char(1) NOT NULL,
    nombre_sucursal varchar2(40) NOT NULL,
    periodo char(6) NOT NULL,
    periodo_salud char(6) NOT NULL,
    nro_radicacion varchar2(10) NOT NULL,
    fecha_pago date NOT NULL,
    nro_pensionados number NOT NULL,
    valor_nomina number(12) NOT NULL,
    tipo_pagador number NOT NULL, -- 1 Empleador 2 AFP 3 Pagador
    operador char(2) NOT NULL,
    sit_periodo number DEFAULT 1 NOT NULL 
)
tablespace TS_ADAMDATOS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Create/Recreate primary, unique and foreign key constraints 
alter table fco_pi_pens_rt1
  add constraint PK_fco_pi_pens_rt1 primary key (compania, anio, mes, sucursal)
  using index 
  tablespace TS_ADAMINDICES
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
