Interesting experience with UTL_FILE in NT4.0 and Unix Environments!!!

From: xxx YYY <xxx-YYY_at_zzz.com>
Date: 1997/08/25
Message-ID: <34020496.43CE_at_zzz.com>#1/1


I use Oracle in both NT4.0 and AIX(a Unix falvour) and I just had an interesting experience with UTL_FILE! I thought it might be helpful for you fellow netters if you started pulling your hair on the same problem too!!

I have written a generic PL/Sql procedure which is supposed to run on both NT4.0 and AIX Oracle, select some data from some tables based on the paramenteres passed to and use UTL_FILE to spit out the results to a flat files. I used the advises of you generous guys/gals posted in the web and usenet and included the UTL_FILE_DIR in the intiXXX.ora file and made sure the trailing Unix:"\" and NT4.0:"/" was there in the directory path!

BUT! When I passed the parameters it worked for AIX but not for NT4.0!? Oh how biazzre! After some struggling I realized the format of the directory parametere passed to the UTL_FILE are not the same!! These are how they should be:

AIX:
file_handle := UTL_FILE.FOPEN('/a_dir/b_dir/', 'out_file.dmp', 'W');

                                           ^
NT4.0
file_handle := UTL_FILE.FOPEN('C:\a_dir\b_dir', 'out_file.dmp', 'W');
                                             ^
[Quoted] Please notice to the spots where "^"s are pointing, as you see the "\" should not be present in order to execute the code successfully on NT!! Just FYI.

Adam (Vahid) Tadj
vahidt_at_vitek.com
Opinions expressed or questions asked are mine not of my employer. Received on Mon Aug 25 1997 - 00:00:00 CEST

Original text of this message