Table joins across databases

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajavale
    New Member
    • Apr 2008
    • 1

    Table joins across databases

    Hello,

    Can someone tell me how one would join tables across different databases, the databases being in the same instance.

    select <field> from database1.table 1 a, database2.table 1 b
    where a.key=b.key

    does not seem to work

    rajavale
  • sakumar9
    Recognized Expert New Member
    • Jan 2008
    • 127

    #2
    This is not possible without federated environment.

    You can try some alternatives like: Export from one table(first database in PC/IXF format), create GTT in second database, import in this GTT and perform select.

    You might want to have a look at the sample SQLLIB/samples/c/dbmcon.sqc. This samples demonstrates how to use two databases simultaneously.

    Let me know if your problem is solved.

    Regards
    -- Sanjay

    Comment

    Working...