Getting PL/SQL: ORA-00942: table or view does not exist in plsql function but not from the command view i have function with a cursor the read the dba_scheduler_jobs which is a view. How can i use a view in a cursor?

create or replace function fn_gss_chk_scheduled_jobs(p_key IN varchar2)
  return boolean is
  --Result     boolean;
  failed_cnt number;
  stas       varchar2(20);
  check_type varchar2(50) := 'Scheduled Jobs';

  cursor c1 is

    select JOB_NAME, COMMENTS
      from dba_scheduler_jobs
     where owner = 'FCUBSPROD'
       AND state &lt;&gt; 'SCHEDULED'
       AND state &lt;&gt; 'RUNNING';

begin

  for rec in c1 loop

    IF c1%FOUND THEN
      Dbms_Output.Put_Line(Rec.Comments);
      stas := 'ERROR';
      pn_gss_update_dash_det(p_key, rec.job_name, rec.comments, 'D');

    ELSE

      stas := 'OK';
    END IF;
  end loop;

  pn_gss_update_dash_det(p_key, check_type, stas, 'S');

  return(true);
end fn_gss_chk_scheduled_jobs;
from sys user -->
grant select any dictionary to 'desired schema';