Monday, January 17, 2011

Running Script in DB2

First copy the script (Using WINSCP from client remotely..see screen shot) on server under any directory and then login on server as db2inst1 user through putty remotely from client machine...(You can also do this by accessing server directly)





First give 'ls' command to see whether the script is in current directory or not where you have copied the script on server..


Now connect with your database ... db2 connect to DATABASENAME

And then give command...        db2     -t      -f     script4.txt

Now enter...

----------------------------------------------------------------------------------------

If this is not working then you have to run each SQL command with out semicolumn (end of each SQL statement in script.txt file)....like this...


db2  "update casetypedocs set mndtstatus='N' where casetypeid=1 "

And then enter..this has to be done for all SQL statements...

If this is also not working then do..
(see below screen)
Type db2 and enter
command  update casetypedocs set mndtstatus='N' where casetypeid=1

No comments:

Post a Comment