Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Setting Directory for utl_file

652774Sep 25 2008 — edited Sep 26 2008
Hi,

We've just installed Oracle 11g on our server, and I'm having trouble determining what the directory name should be so that I can read it. I have tried:

\users\mhoward\temp\
\\servername\users\howardm\temp
s:\servername\users\howard\temp

What I'm doing on the server side is signing on as sys, and doing

create or replace directory tempdir as 'c:\temp';
grant read on directory tempdir to username;

Then I look over at SQL Developer, and I do find the tempdir listed.

Then I attempt to run a program. Here's my program:

create or replace
PROCEDURE proc_load1
IS
user_name VARCHAR2(30) := user;
fhandler utl_file.file_type;
buf varchar2(4000);
BEGIN
fhandler := utl_file.fopen('tempdir','oracletest.txt','R');
utl_file.fclose(fhandler);
exception
when utl_file.invalid_path then
raise_application_error(-20000, 'Invalid path');
end;


But, I keep getting invalid path!

Would someone please tell me what I need to put in as the directory path for Windows on the server? I would like to point it to s:\users\howardm\temp, but I'm not sure how to do that.

-Mary
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2008
Added on Sep 25 2008
6 comments
2,122 views