G
Guest
I have written a SQL statement to extract data from an Oracle database with a variable &1. I have tested the sql statement and am confident that the statement is correct (in place of the variable I used an identifier for this test - otherwist, the statement would not work using SQLPLUS alone). The aim is to use a "print" button on the front end gui (client 6i engine 8i) to run a Word output. I am not interested in doing a mail merge etc. as I want to use preformatted SQL and a batch file triggered by the database to spool the SQL into a Word document.
I already have a batch file which does not suit the purpose but at least copies the sql, connects to sqlplus and opens word (I will attach the batch file a the end with it's result).
*******************************************
copy start.sql+%3+finish.sql temp.sql
set FILEN=dt%username%
sqlplus %4/%5@%6 @temp.sql %1 %TEMP% %FILEN%
"C:\Program Files\Microsoft Office\Office\winword.exe" /t %2 / mmerge
exit
*******************************************
the variables from %2 to %6 are from the Oracle database and I presume that %1 is already set to the identifier I specify.
Do you have the solution?
I already have a batch file which does not suit the purpose but at least copies the sql, connects to sqlplus and opens word (I will attach the batch file a the end with it's result).
*******************************************
copy start.sql+%3+finish.sql temp.sql
set FILEN=dt%username%
sqlplus %4/%5@%6 @temp.sql %1 %TEMP% %FILEN%
"C:\Program Files\Microsoft Office\Office\winword.exe" /t %2 / mmerge
exit
*******************************************
the variables from %2 to %6 are from the Oracle database and I presume that %1 is already set to the identifier I specify.
Do you have the solution?