Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Is Joining tables from two separate oracle databases possible?

Re: Is Joining tables from two separate oracle databases possible?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 28 Feb 2001 21:32:18 -0800
Message-ID: <3A9DDEE2.87720EF5@exesolutions.com>

> I'm have oracle 8.1 client installed on my NT box and two databases I
> have access to via tcp/ip and mention in tnsnames.ora. Is there a way
> via sql to access both databases at the same time and do a simple
> join...like lastname to lastname???
>
> If not are there ways of doing this? do I need third party software?

The capability you want is built into Oracle and is called a database link. You create a database link from one instance to the other. Then you can select from either or both instances simultaneously as follows:

SELECT a.field1, b.field2
FROM localtable a, otherinstancetable_at_dblinkname b WHERE a.field3 = b.field3;

Daniel A. Morgan Received on Wed Feb 28 2001 - 23:32:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US