Create or Replace View vw_fco_hist_traslados_eps
As
select compania,
       trabajador,
       dato,
       fecha_alta
from hist_agrupaciones h
where agrupacion = 
    nvl((SELECT dato FROM vw_fdt_parametros x
     WHERE pais = 'COL' AND x.compania = h.compania
       AND x.parametro = 'autoliq' AND x.secuencia = 21), 'EPS');


CREATE PUBLIC SYNONYM vw_fco_hist_traslados_eps FOR ADAM.vw_fco_hist_traslados_eps;
GRANT ALL ON vw_fco_hist_traslados_eps TO ADAMA;                  
