Solved

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

Posted on 2008-10-20
2
299 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now