If you have a batch file set to run multiple SQLPlus queries and to then perform some other action such as merge the results together into a single file, or copy the files elsewhere you need to physically exit SQLPlus or the batch file will not continue to run and execute the commands.
To exit SQLPlus automatically skip a line after your last query and type exit as in
To run multiple SQLPlus queries as part of a DOS batch file place all the queries in a separate SQL file. For Example
Save the file as runall.sql. Then use this file in your batch file
You can merge multiple csv or text files with a simple DOS command. Copy the code below into a text editor and save the file with a .bat extension. Save the file in the same folder as the csv files.
I've used this as part of an import routine. Step one produces a set of csv files from SQL queries on an Oracle database. Step two merges all the csv files together. Step three imports a single file into Sage MMS
© Eriginal Ltd 2011, all rights reserved