WHEN utl_file.invalid_path THEN
WHEN utl_file.invalid_mode THEN
WHEN utl_file.invalid_filehandle THEN
WHEN utl_file.invalid_operation THEN
WHEN utl_file.read_error THEN
WHEN utl_file.write_error THEN
WHEN utl_file.internal_error THEN
WHEN OTHERS THEN
With the UTL_FILE package, your PL/SQL programs can read and write operating system text files. UTL_FILE provides a restricted version of operating system stream file I/O.
UTL_FILE I/O capabilities are similar to standard operating system stream file I/O (OPEN, GET, PUT, CLOSE) capabilities, but with some limitations. For example, you call the FOPEN function to return a file handle, which you use in subsequent calls to GET_LINE or PUT to perform stream I/O to a file. When file I/O is done, you call FCLOSE to complete any output and free resources associated with the file.
I guess that create directories with CREATE DIRECTORY can be an option. Really I do not know if CREATE DIRECTORY feature is available for Oracle7. Find out that information or try to create a directory.
I have created directories in folders of the same OS and I have not had problems but I have not tested with mapped folders.
SQL> CREATE DIRECTORY log_dir AS '/appl/gl/log';
SQL> GRANT READ ON DIRECTORY log_dir TO DBA;
SQL> CREATE DIRECTORY out_dir AS '/appl/gl/user'';
SQL> GRANT READ ON DIRECTORY user_dir TO PUBLIC;
So do this:
1.- Try to create a directory with sentences alike like appears above.
2.- Try to run your procedure
3.- If neither of last option functions you can set the init parameter UTL_FILE_DIR=* and test it again.
Check out W2K Service for your Oracle Instance.
Go to Login options and see if it is using Local System logon. The local system user has no rights to any shares. So, change it to logon using your account or any account that has access to shares.
Anoher tip: don't use logical drive letter (G, use UNC full name (like \\xxx\xx\xxx) on INITxxx.ORA and FOpen.
I agree with Pablo. However, must add one thing... since Windows does not actually connect to the share without a physical account logged into the local machine, Oracle won't be able to see the share either. We've found that we had to keep the console logged in, but locked in order to have the connection kept alive.