Folks,
I need to create a batch file that will do the following -
Establish a DB2 instance
Connect to a certain database
Get data using an sql and output it to a file
So, this is what I have done in my test.cmd file
My first command is -
"%ProgramFiles%\ibm\sqllib\bin\db2cmd" /i /w db2 connect to
<db> user <uid> using <pwd>
And this connects me fine.
My second command is -
"%ProgramFiles%\ibm\sqllib\bin\db2cmd" /i /w db2 -tvf
TimSConfqty.sql
This does not execute in batch mode - since it appears that a new
instance of a window was created. If I type in this command at the DOS
prompt created by the 1st command, it works fine. But, it never
executes from the batch test.cmd file. If I type exit at the DOS prompt
- the instance exits and test.cmd continues onto attempting to execute
the 2nd command (which fails, since the first window (instance ?) was
closed.
I think I understand the problem, don't know how to solve it. Well,
maybe I don't understand the problem. Any thoughts ?
Thanks.