utl_file_dir in oracle 10g - gives invalid path error..

I have a sample procedure which when executed gives

CREATE OR REPLACE PROCEDURE EmployeeFlatFile
IS
  file_id UTL_FILE.FILE_TYPE;
BEGIN
  file_id := utl_file.FOPEN( '/apps/myuser/output', 'test.txt', 'w' );
  FOR emp IN (SELECT employee_name FROM employee)
  LOOP
     utl_file.PUT_LINE( file_id, emp.employee_name );
  END LOOP;
  utl_file.fCLOSE(file_id);
END;
/
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 436
ORA-06512: at "myschema.employeeflatfile", line 5
ORA-06512: at line 2

dba's assured that they have the entry /apps/myuser/output in the utl_file_dir (init.ora) and the same setting works in oracle 8i - how do I rectify this problem,.. any suggestions are welcome!!!


mahjagAsked:
Who is Participating?
 
sathyagiriConnect With a Mentor Commented:
Ask your DBA to create a directory object pouinting to the above dir and grant access to you

CREATE DIRECTORY OUTPUT AS '/apps/myuser/output'

GRANT READ,WRITE ON DIRECTORY output TO user;

In your stored proce replace the abosulute path with this name <OUTPUT>
0
 
mahjagAuthor Commented:
DBA's are gone for the day, it will be tomorrow that I can try this,.,

can I find out from querying 8i has the directory name created there, I dont see this as a problem in 8i and wanted to find out if this is just 10g problem..
0
 
sathyagiriCommented:
select * from all_directories;
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
SujithData ArchitectCommented:
Check whether the directory exists in the file system. And check whether there are sufficient access permissions on this directory.

It is advisable that you change the code to use directory objects instead of utl_file_dir.
0
 
mahjagAuthor Commented:
directories have all read write execute chmod 777 output
0
 
mahjagAuthor Commented:
DBA's are letting me know that they only want to change init.ora util_file_dir parameter and not do the directories as the former worked fine in all previous versions..

One problem though that multiple path provided for util_file_dir did not work, only one path,"/apps/myuser/output" worked but I wanted also multiple path to work , like wanted to generate files in different folders but unfortunately we cannot do that now.. Any ideas?

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
utl_file_dir                         string      /apps/myuser/output,/apps/myuser
                                                 /dealer,/apps/myuser/direct

This setting is not working..
                                                 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.