Is there a way I can run a query from one database in DB2 to another database in DB2?
For example I have two databases:
- Sample
- Target
I will write a query in target and I will call the table which is there in sample database. But, it should execute it in target database.
To do this you need to use Federation.
You will catalog a table from sample database in target database. You will have a nickname in target database, and you can do any query on this table (nickname) as it were local. DB2 will call the other database, and retrieve the data.
However, the real execution is in sample database, the only thing is that you call execution from target database.
When you use different types of databases, you use InfoSphere Information Server 8.7 in order to connect to Oracle, SQL server, etc.
For DB2 and Informix it used to be included (you have to check it)
For more information http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.dbobj.doc/doc/c0004122.html