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!!!
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
select * from all_directories;
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.
It is advisable that you change the code to use directory objects instead of utl_file_dir.
ASKER
directories have all read write execute chmod 777 output
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/direc t
This setting is not working..
One problem though that multiple path provided for util_file_dir did not work, only one path,"/apps/myuser/output"
NAME TYPE VALUE
--------------------------
utl_file_dir string /apps/myuser/output,/apps/
/dealer,/apps/myuser/direc
This setting is not working..
ASKER
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..