DROP TABLE adam.fco_fantasmas;
CREATE TABLE ADAM.fco_fantasmas
(
    compania    char(4) NOT NULL,
    trabajador  char(10) NOT NULL,
    anio        number(5) NOT NULL,
    mes         number(3) NOT NULL,
    sucursal    char(10) NOT NULL,
    tipo_id     char(2) NOT NULL,
    nro_id      varchar(16) NOT NULL,
    tipo_cotizante number(2) NULL,
    primer_apellido varchar2(20) NOT NULL,
    segundo_apellido varchar2(30) NOT NULL,
    primer_nombre varchar2(20) NOT NULL,
    segundo_nombre varchar2(30) NOT NULL,
    AFP         char(10) NOT NULL,
    EPS         char(10) NOT NULL,
    CCF         char(10) NOT NULL,
    CTR         char(10) NOT NULL,    
    dias_AFP    number(2) NOT NULL,
    dias_EPS    number(2) NOT NULL,
    dias_ARP    number(2) NOT NULL,
    dias_CCF    number(2) NOT NULL,
    salario     number(9,0) NOT NULL,
    IBC_AFP     number(9,0) NOT NULL,
    IBC_EPS     number(9,0) NOT NULL,
    IBC_ARP     number(9,0) NOT NULL,
    IBC_CCF     number(9,0) NOT NULL,
    aporte_AFP  number(9,0) NOT NULL,
    aporte_FSP_sol  number(9,0) NOT NULL,
    aporte_FSP_sub  number(9,0) NOT NULL,
    aporte_EPS  number(9,0) NOT NULL,
    UPC_adicional number(9,0) NOT NULL,
    tarifa_ARP number(9,8) NOT NULL,
    aporte_ARP  number(9,0) NOT NULL,
    aporte_CCF	number(9,0) NOT NULL,
    aporte_SENA	number(9,0) NOT NULL,
    aporte_ICBF	number(9,0) NOT NULL,
    aporte_ESAP	number(9,0) NOT NULL,
    aporte_MEdu	number(9,0) NOT NULL,
    extranjero char(1) NOT NULL,
    residente_exterior char(1) NOT NULL,
    departamento char(2) NOT NULL,
    municipio char(3) NOT NULL,
    planilla_pens number(1) NOT NULL,
    tipo_planilla char(1) NULL,
    CONSTRAINT PK_fco_fantasmas PRIMARY KEY (compania, trabajador)
    USING INDEX TABLESPACE TS_ADAMINDICES
)
TABLESPACE TS_ADAMDATOS;

CREATE PUBLIC SYNONYM fco_fantasmas FOR ADAM.fco_fantasmas;
GRANT SELECT, INSERT, UPDATE, DELETE ON fco_fantasmas TO ADAMA;
