ITPub博客

首页 > 数据库 > Oracle > ORA-00942

ORA-00942

原创 Oracle 作者:action929 时间:2008-06-13 17:28:38 0 删除 编辑
能访问的表,却抱 ORA-00942[@more@]

今天写了个function:

create or replace function show_pkg (name in varchar2) return varchar2
is
v_code varchar(1000);
cursor c_code is
select a.text from sys.dba_source a
where a.owner='MAS9I' and a.name=upper(name) and a.type='PACKAGE BODY';
begin
open c_code;
loop
fetch c_code into v_code;
exit when c_code%notfound;
dbms_output.put_line(v_code);
end loop;

end;

编译的时候抱错:ORA-00942: table or view does not exist ,可是用该用户是可以访问 DBA_SOURCE的,为啥写到function会抱错呢

翻查了资料才知道 要赋select any dictionary 的权限,可是为什么会这样,还是搞不懂

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/133835/viewspace-1005651/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: sqlplus失去响应
请登录后发表评论 登录
全部评论
  • 博文量
    40
  • 访问量
    313759