We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

mahjag
mahjag asked
on
Medium Priority
3,941 Views
Last Modified: 2008-02-20
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!!!


Comment
Watch Question

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>

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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..
select * from all_directories;
SujithData Architect
CERTIFIED EXPERT

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

Author

Commented:
directories have all read write execute chmod 777 output

Author

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..
                                                 
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.