Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect to DB2 database from shell script

Status
Not open for further replies.

Sree1986

Programmer
Mar 16, 2015
1
AU
Hi,
I want to connect to my DB2 database, execute a query and store the result from a shell script. The database is not in the linux server from which the scripts need to be executed.

Any help is much appreciated.

Thanks in advance
 
db2 connect to <database-alias> user <username> using <password>

db2 "<the query to be executed>" >> outputfile.txt

db2 connect reset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top