we can use the following script to initialize db2 environment in command line mode of windows server and run any sql query on it.
@echo off
rem If we’re not called from DB2CLP, call ourselves again
if “%DB2CLP%” == “” db2cmd /c /i /w %0 %* & goto :eof
rem Now the real stuff
db2 connect to MYDB
db2 select * from sysibm.sysdummy1
db2 connect reset
rem etc.
this is a nice solution to run db2 scripts in windows batch mode.
Advertisement