Home » SQL & PL/SQL » SQL & PL/SQL » error in using the utl_file package (oracle 10g XE)
error in using the utl_file package [message #434632] Thu, 10 December 2009 00:48 Go to next message
mohannksr
Messages: 28
Registered: January 2009
Junior Member
Hi,

I have installed oracle 10g at the location

D:\oracle_XE_server\app\oracle\product\10.2.0\server\BIN

and i have created the file name NAMES.TXT at the location

C:\oracle

my OS is windows.


Please find the below scripts.

SQL> connect sys/xxxx as sysdba
Connected.
SQL> drop directory filesdir;

Directory dropped.

SQL> create directory filesdir as 'c:\oracle';

Directory created.

SQL> grant read on directory filesdir to public;

Grant succeeded.

SQL> grant write on directory filesdir to public;

Grant succeeded.

SQL> grant execute on UTL_FILE to public;

Grant succeeded.

SQL> connect SYSTEM/xxxx
Connected.
SQL> DECLARE
2 line VARCHAR2(100);
3 namesfile UTL_FILE.FILE_TYPE;
4 BEGIN
5 namesfile := UTL_FILE.FOPEN('FILESDIR','NAMES.TXT','R'); -- open in read mode
6 UTL_FILE.FCLOSE(namesfile);
7 END;
8
9 /
DECLARE
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 475
ORA-29283: invalid file operation
ORA-06512: at line 5


SQL>
SQL> spool off;

Could any please help me on this..?
Re: error in using the utl_file package [message #434641 is a reply to message #434632] Thu, 10 December 2009 01:25 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Does the owner of the instance (not you) has read access to the directory and file?
Check who started the instance.

Regards
Michel
Re: error in using the utl_file package [message #434676 is a reply to message #434641] Thu, 10 December 2009 04:09 Go to previous message
mohannksr
Messages: 28
Registered: January 2009
Junior Member
hi michel,

thanks for your suggestion...

by changing the location(a location where the instance owner has the read/write access) it worked successfully....

location- 'C:\Documents and Settings\XXX\Desktop\XE';

Previous Topic: Job scheduling problem
Next Topic: Ref Cursor
Goto Forum:
  


Current Time: Fri Dec 02 16:32:41 CST 2016

Total time taken to generate the page: 0.22073 seconds