Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Exception:utl_file.invalid_path

429870Sep 21 2004 — edited Sep 26 2004
I'm trying to read files on os system.And I user windows 2000 server and my oracle is 9i.I do something below,but I get the Exception:utl_file.invalid_path.does anybody know how to resolv this problem?
1、SQL> connect system
Enter password: ******
Connected.

2、SQL> create directory utl_file_dir as 'c:\temp\UTL_FILE';
Directory created.
3、C:\>mkdir c:\temp\UTL_FILE
4、select * from all_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
--------------- -------------------- ----------------------------------------
SYS MEDIA_DIR d:\avale\rel4\demo\schema\product_media\
SYS LOG_FILE_DIR d:\avale\rel4\assistants\dbca\logs\
SYS DATA_FILE_DIR d:\avale\rel4\demo\schema\sales_history\
SYS UTL_FILE_DIR c:\temp\UTL_FILE
5、run pl/sql block

DECLARE
fh UTL_FILE.FILE_TYPE;
BEGIN
fh := UTL_FILE.FOPEN('UTL_FILE_DIR', 'test.txt', 'w');
UTL_FILE.PUT_LINE(fh, 'Hello World');
dbms_output.put_line('2');
UTL_FILE.FCLOSE(fh);
EXCEPTION
WHEN utl_file.invalid_path THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.invalid_path');
WHEN utl_file.invalid_mode THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.invalid_mode');
WHEN utl_file.invalid_filehandle THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.invalid_filehandle');
WHEN utl_file.invalid_operation THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.invalid_operation');
WHEN utl_file.read_error THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.read_error');
WHEN utl_file.write_error THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.write_error');
WHEN utl_file.internal_error THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.internal_error');
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20001, 'utl_file.other_error');
END;
/

But I get the exception:utl_file.invalid_path.
who can tell me why?Thank you!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2004
Added on Sep 21 2004
5 comments
781 views