Link to home
Start Free TrialLog in
Avatar of mahjag
mahjag

asked on

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!!!


ASKER CERTIFIED SOLUTION
Avatar of sathyagiri
sathyagiri
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mahjag
mahjag

ASKER

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..
select * from all_directories;
Avatar of Sujith
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.
Avatar of mahjag

ASKER

directories have all read write execute chmod 777 output
Avatar of mahjag

ASKER

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..