视图数据库是oracle数据库,单独查询sql语句是正常
select 科室,住院号,病人姓名,主刀医生,工号,切皮时间,手术出室时间,手术入室时间 from v_jfglxt@NPS where to_char(切皮时间,'yyyy-mm-dd')=v_dates   通过dblink读取数据保存到自己表。在过程里报pL/SQL:ORA-00942:表或视图不存在;
   --手术开台时间
   procedure p_collect_Surgery(v_dates in varchar2) is
      s_dept_id  varchar2(32);--部门ID
      s_Doctor_id  varchar2(32);--医生ID
      s_cnt number(8);---查询总数据量(每天)
     begin
       s_cnt:=0; 
       select count(*) into s_cnt from yz_medicalview_surgery where to_char(in_time,'yyyy-mm-dd')= v_dates;
        if s_cnt<1 then
       for mycur in(select 科室,住院号,病人姓名,主刀医生,工号,切皮时间,手术出室时间,手术入室时间 from v_jfglxt@NPS where to_char(切皮时间,'yyyy-mm-dd')=v_dates)loop       s_dept_id:=select_util.f_dept_id(mycur.科室);
       s_Doctor_id:=select_util.f_user_ids(mycur.工号);
       --开始插入
       insert into yz_medicalview_surgery(view_id,dept_name,doctor_staffnumber,doctor_user_id,patient_name,patient_no,in_time,surgery_begin_time,surgery_end_time,dept_id,doctor_name)
       select seq_yz_surgery.nextval,mycur.科室,mycur.工号,s_Doctor_id,mycur.病人姓名,mycur.住院号,mycur.切皮时间,mycur.手术入室时间,mycur.手术出室时间,s_dept_id,mycur.主刀医生 from dual;
     commit;
   end loop;
   end if;
   end p_collect_Surgery;