In Windows DOS, you need to run db2cmd before you can do any db2 command. If you want to run multiple commands, usually you can output the commands into a file and call db2cmd like this:
db2cmd -c db2 -tvf cmd_file.sql
But if you don't want to generate a file, here is how
db2cmd -c db2 connect to mydb user me using passwd && db2 select * from my_table && db2 terminate
What's the error? Could you try to double quoted the commands? db2cmd -c "db2 connect to mydb user me using passwd && db2 select * from my_table && db2 terminate"
I tried in that way. It is not working. Please try to assist me.
ReplyDeleteWhat's the error? Could you try to double quoted the commands?
Deletedb2cmd -c "db2 connect to mydb user me using passwd && db2 select * from my_table && db2 terminate"