1

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
  • is db2 running on the unix box? Commented Jul 12, 2012 at 19:44

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.