Need to connect to DB2 database by using unix shell script I am using QMF tool to run DB2 queries everytime. Now i need to connect this through shell script. DSN name --GM2P DB name-- DPPRICMG table name--item Any help and suggestions would be appreciated. can anyone please answer this ASAP. Thanks
1 Answer
In order to run the script properly you must be cataloged the remote database as this:
db2 catalog tcpip node NODE1 remote ip.ip.ip.ip server 50000
db2 catalog database mydb1 at node NODE1 authentication server
Then you can use this script to issue any sql you want:
db2 connect to mydb2 user username using password
db2 "update bla bla bla "
db2 connect reset
Note that if you are using DB2 for z/OS, then cataloging will be a bit different.