View Single Post
 
Old October 15th, 2009, 02:46 AM
om_prakash om_prakash is offline
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Create a database link.

You have the two databases: "Database1" and "Database2".
In "Database1", create a link to "Database2"

like so: (logged in as user with create link privilege)
create public database link "Database2"

connect to "Database2user" identified by "Database2userpassword" using "Database2";
Then in Database1, you should be able to write a select statement along these lines:

SELECT tab1.col1, tab2.col2 FROM table1 tab1 --table in "Database1",table2@"Database2" tab2 --table in "Database2"
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.

Last edited by om_prakash; October 15th, 2009 at 02:50 AM..