Solved

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

Posted on 2008-10-20
2
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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…

733 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