Exception:utl_file.invalid_path
429870Sep 21 2004 — edited Sep 26 2004I'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!