Home » RDBMS Server » Server Utilities » UTL_FILE question (Oracle 8.1.7)
UTL_FILE question [message #309555] Thu, 27 March 2008 19:50 Go to next message
kowalsky
Messages: 37
Registered: May 2003
Member
Hi all,
I am confused by the fact that when issuing
CREATE DIRECTORY myDir AS '\\mymachine\some\path\';
with TOAD 7.4 I can see that the directory object is created.

When I try to open a file with UTL_FILE.FOPEN('myDir', 'myFile.txt', 'r') I get invalid path.

Regardless of the fact that maybe the path is invalid, or the user that tries to access the file system may not have the appropriate permissions to do just that, I thought that prior to Oracle 9i, the only way to use UTL_FILE is to modify the init.ora file and specify a value for utl_file_dir and that would be the location where I have to keep my files.

Which is it? Is it worthless to create the directory object (even though you can) for utl_file use?

Thanks,
kowalsky
Re: UTL_FILE question [message #309556 is a reply to message #309555] Thu, 27 March 2008 20:33 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
http://www.cs.bris.ac.uk/maintain/OracleDocs/server.816/a76989/ch4f7.htm#28399

used for BFILE.
For UTL_FILE, use UTL_FILE_DIR (create directory in 9i)
Re: UTL_FILE question [message #309557 is a reply to message #309555] Thu, 27 March 2008 20:46 Go to previous messageGo to next message
kowalsky
Messages: 37
Registered: May 2003
Member
the real problem is that Oracle does not work too well with network shares; basically the user under which Oracle runs will seldom have rights to access anything on a network ... see below.
http://www.jlcomp.demon.co.uk/faq/utl_file.html
Re: UTL_FILE question [message #309560 is a reply to message #309555] Thu, 27 March 2008 21:30 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
When Creating Directory Object Oracle does not check whether path provided is correct or not.It's your responsibility.

Ask your Network administrator to grant acccess to that directory at Operating System level.

Re: UTL_FILE question [message #309562 is a reply to message #309557] Thu, 27 March 2008 22:07 Go to previous message
Barbara Boehmer
Messages: 8635
Registered: November 2002
Location: California, USA
Senior Member
Additionally, 'MYDIR' must be in upper case, when passed as a parameter to utl_file.fopen.
Previous Topic: Commit point reached - logical record count 64
Next Topic: export and import
Goto Forum:
  


Current Time: Wed Dec 07 04:42:39 CST 2016

Total time taken to generate the page: 0.34095 seconds