PLS-00201:必须声明标识符UTIL_FILE [英] PLS-00201: identifier UTIL_FILE must be declared

查看:305
本文介绍了PLS-00201:必须声明标识符UTIL_FILE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将查询中的数据从Windows Server 2008计算机上安装的Oracle Enterprise Express导出到csv文件中.

I'm trying to export data from a query into a csv file from Oracle Enterprise Express installed on a Windows Server 2008 machine.

我找到了此解决方案:

http://asktom.oracle.com/pls /asktom/f?p = 100:11 ::::: P11_QUESTION_ID:235814350980

基本上是编写一个函数,并使用UTIL_FILE对象创建和写入文件并添加定界符.

which basically writes a function and uses the UTIL_FILE object to create and write to a file and add delimiters.

当我尝试在Oracle SQL Developer中创建函数时收到以下错误:

I receive the follow error when I try and create the function in Oracle SQL Developer:

PLS-00201: identifier UTIL_FILE must be declared. 

当我运行以下命令时:

select owner, object_type from all_objects where object_name = 'UTL_FILE' 

结果是:

OWNER      Object Type
---------  -----------
PUBLIC     SYNONYM

运行:

GRANT EXECUTE ON UTL_FILE TO PUBLIC

赠予:

Error starting at line 2 in command:
GRANT EXECUTE ON UTL_FILE TO PUBLIC
Error report:
SQL Error: ORA-00942: table or view does not exist
00942. 00000 -  "table or view does not exist"
*Cause:    
*Action:

出什么问题了?

推荐答案

对我来说似乎缺乏特权.通常PUBLIC用户对该软件包具有EXECUTE特权,但是该特权可能会被撤销.

Seems like lack of privileges to me. Often PUBLIC user has EXECUTE privilege granted on that package, but the privilege may be revoked.

您可以通过发出以下查询来检查PUBLIC是否具有该特权:

You can check if PUBLIC has that privilege by issuing the following query:

SELECT * FROM all_tab_privs WHERE grantee = 'PUBLIC' AND table_name = 'UTL_FILE';

如果没有返回任何行,请尝试将执行特权授予某些用户(例如,SYS:

If there are no rows returned, try granting the execute privilege to either the user you are logged as, or to PUBLIC, as some privileged user, for example SYS:

GRANT EXECUTE ON SYS.utl_file TO user_name;

修改

例如,以SYS用户身份登录时,您必须授予特权.

You must grant the privilege while being logged as, for example, SYS user.

这篇关于PLS-00201:必须声明标识符UTIL_FILE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆