Home » RDBMS Server » Server Administration » How do I query tables from 2 databases?
How do I query tables from 2 databases? [message #370802] Wed, 09 February 2000 16:50 Go to next message
kat
Messages: 15
Registered: February 2000
Junior Member
Hi,
it must be a simple question for everyone else but I am trying to figure out how to query tables from 2 different databases with 2 different sets of connection strings. Thanks in advance.
Re: How do I query tables from 2 databases? [message #370803 is a reply to message #370802] Wed, 09 February 2000 17:50 Go to previous messageGo to next message
MikeG
Messages: 14
Registered: August 1999
Junior Member
You need to create a database link from one to the other.
Re: How do I query tables from 2 databases? [message #370813 is a reply to message #370802] Thu, 10 February 2000 13:55 Go to previous messageGo to next message
Edward Jayaraj
Messages: 7
Registered: December 1999
Junior Member
Create a database link between the two database.
and use the link in the query.

Create database link link_name connect to user_name identified by Pwd using 'host_string'

then use the link name as follow:
select *
from table_name@lnk_name ;

This should work for you.......

Let me know if u have any issue with it.

Thanks
Re: How do I query tables from 2 databases? [message #370816 is a reply to message #370813] Thu, 10 February 2000 18:57 Go to previous message
Nell
Messages: 7
Registered: February 2000
Junior Member
Hi, thanks so much for your reply. The fact is I am using the database link:
select * from table@linkName;

I just didnt know I have to create the link. I am very new to Oracle. I was told to connect by writing my select statement using table@Link(only now I know that is called a link) and thought that's all I need to access remote data. Now I know you have to create the link too. Oh, well, it's always nice to learn new stuff. Thanks again, I really appreciate it.
Previous Topic: test
Next Topic: Crosstab query??
Goto Forum:
  


Current Time: Fri Apr 19 18:28:22 CDT 2024