Home » SQL & PL/SQL » SQL & PL/SQL » Selecting records from tables in separate Oracle Databases
Selecting records from tables in separate Oracle Databases [message #171] Wed, 23 January 2002 15:25 Go to next message
Mark
Messages: 284
Registered: July 1998
Senior Member
Please Help,

I have 2 tables located in separate databases on the same server. I am trying to write a SQL select query to pull the information from these tables together via a common field in both tables.

I would greatly appreciate if someone could tell me what the correct syntax is to do this.

This is an Oracle 7 database running on an Alpha with OpenVMS.

Thank you,
Re: Selecting records from tables in separate Oracle Databases [message #176 is a reply to message #171] Thu, 24 January 2002 04:38 Go to previous message
Ajay Gandhi
Messages: 14
Registered: January 2002
Junior Member
Steps:
1. Create a database link from Database1 to Database2. (e.g. db link name is xyz)
2. write a sql statement joining the two tables and the second tables will be suffixed by the db link name)
e.g. select count(*)
from table1 a, table2@xyz b
where a.column1 = b.column2

Hope that helps

Previous Topic: about triggers
Next Topic: Cannot commit in a trigger
Goto Forum:
  


Current Time: Fri Apr 19 20:30:00 CDT 2024