create or replace function adam.fn_fco_vsp(p_compania   in char,
                                           p_trabajador in char,
                                           p_periodo    in char)
  return varchar2 is
  Result varchar2(1);
begin
  begin
    select 'X'
      into result
      from vw_fco_sueldos x
     where x.compania = p_compania
       and x.trabajador = p_trabajador
       and to_char(x.fecha, 'YYYYMM') = p_periodo;
  exception
    when no_data_found then
      result := ' ';
  end;
  return(Result);
end fn_fco_vsp;
/
