Home » RDBMS Server » Server Administration » UTL_FILE giving INVALID_PATH error
UTL_FILE giving INVALID_PATH error [message #370130] Tue, 19 December 2000 11:00 Go to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
I am trying to open a text file that is on the Oracle server (physical box) from a PL/SQL package.

I am using the UTL_FILE package to do this.
When I do a FOPEN on the file specifying the location and the file name

file_handle :=
UTL_FILE.FOPEN('/tmp/', 'fd_file.txt', 'R');

The above statement is throwing a UTL_FILE.INVALID_PATH exception.

I have the directory setup in init.ora of the database instance as

UTL_FILE_DIR = /tmp

I am not able to find any documentation to tell me why it is failing. The directory is completely open with all rights on the file.

Please help me figure this out.

Thank you.

Here is the entire procedure

procedure p_load_food_groups (
file_location IN VARCHAR2,
file_name IN VARCHAR2
) is
food_groups_file UTL_FILE.FILE_TYPE;
line_out VARCHAR(200);
begin
--food_groups_file := UTL_FILE.FOPEN(file_location,
file_name, 'R');
food_groups_file := UTL_FILE.FOPEN
('/tmp/', 'fd_group.txt', 'R');

IF UTL_FILE.IS_OPEN (food_groups_file) THEN
DBMS_OUTPUT.PUT_LINE ('The file is open.');
UTL_FILE.GET_LINE(food_groups_file, line_out);
END IF;

DBMS_OUTPUT.PUT_LINE ('In Here.');

EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN
DBMS_OUTPUT.PUT_LINE ('INVALID_PATH Exception
has occured.');

end pkg_Load_USDA;
Re: UTL_FILE giving INVALID_PATH error [message #370131 is a reply to message #370130] Tue, 19 December 2000 11:48 Go to previous messageGo to next message
mekala
Messages: 2
Registered: December 2000
Junior Member
Donot put '/' at the end of the DIR name.
Try this.
UTL_FILE.FOPEN('/tmp', 'fd_group.txt', 'R');
Re: UTL_FILE giving INVALID_PATH error [message #370132 is a reply to message #370131] Tue, 19 December 2000 15:28 Go to previous message
Raj
Messages: 411
Registered: November 1998
Senior Member
I have tried this and several other variations,
but the exception still occurs.

Please help.
Previous Topic: Mapping C structs for external procedures
Next Topic: Mutltible colums with MINUS-criteria
Goto Forum:
  


Current Time: Thu May 16 21:07:11 CDT 2024