UTL_FILE giving INVALID_PATH error [message #370130] |
Tue, 19 December 2000 11:00 |
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;
|
|
|
|
|