Solved

How do we join 2 DB2 databases within the same instance.

Posted on 2008-10-20
2
343 Views
Last Modified: 2012-05-05
We have a need to join tables across two DB2 databases in the same instance.  Is a federated system our only option?  How do we set it up ... both databases are in the same instance. Are there performance implications?
0
Comment
Question by:ausrs
2 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 125 total points
ID: 22764527
if the two databases are in the same instance you don't need federated systems
you just add the database name as a prefix for your object, for example, if you have table schema1.table1 in db1 and table schema2.table2 in db2 you perform

select *
from db1.schema1.table1 inner join db2.schema2.table2 on ....
0
 

Author Comment

by:ausrs
ID: 22956910
Thanks ... I understand this works for DBMSs other than DB2.  In DB2 you must set up a nickname to the remote database, even if it is in the same instance and then you can perform the joins.  I was hoping this was not the case because I underatnd that performance may be impacted with federated systems.  
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question