DB2 initializing in batch mode

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.