N/APosted on - 10/21/2014
I have some more questions DB2 SQL frequently.It takes a long time to run it manually. For that, I plan to create a batch file to run the DB2 SQL commands. So please let me know if it is possible to create a Windows command file to define SQL queries DB2 Run ?
How to create batch file to execute multiple DB2 queries
Yes, it is possible. Consult guides for scripting in the Windows shell or consult the shell itself for more information related to organizing information and appropriate syntax. Make your file with the extension “.bat” and save it in the appropriate folder. Navigate to the folder. Use the command “db2cmd” for proper access and initiation. Then locate the script and run it. Here is a very simple sample Windows script file:
db2 -x connect to XX user XXX USING xxx
db2 -x set current sqlid='xxx'
db2 -x set current path=zzz, current path