Here is a brief summary for creating a csv file using TCL: 1. logon to smq freenx (tcl86 was installed on the smq freenx) 2. run the profile to set the Oracle parameters ex. --file oraprofile.sh cat oraprofile.sh export ORACLE_HOME=/usr/local/oracle/instantclient_11_1 export ORACLE_LIBRARY=$ORACLE_HOME/libclntsh.so.11.1 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/NX/lib:$ORACLE_HOME export PATH=/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:$HOME/bin:/usr/local/tcl86/bin:/usr/local/oracle/instantclient_11_1 export TNS_ADMIN=$HOME 3. create the tnsnames.ora file 4. modify the template.tcl as per ticket ie. cp template.tcl tk999999.tcl replace the output filename replace the query in the tk999999.tcl update the id/pw in the tk999999.tcl 5. execute the tcl program to generate the output file tclsh8.6 tk999999.tcl