Selacius Posted March 22, 2006 Share Posted March 22, 2006 I am aware I can use the Insert Select query, but I am curious how to do that when the two tables are in separate databases? Link to comment Share on other sites More sharing options...
Prakash Posted March 22, 2006 Share Posted March 22, 2006 I am aware I can use the Insert Select query, but I am curious how to do that when the two tables are in separate databases?<{POST_SNAPBACK}> You need to go for Data Warehousing Tools like Erwin, Informatica..Try to use Erwin. It's very to useful while working with multiple databases.Bye. Link to comment Share on other sites More sharing options...
Rachit Shah Posted March 22, 2006 Share Posted March 22, 2006 I am aware I can use the Insert Select query, but I am curious how to do that when the two tables are in separate databases?<{POST_SNAPBACK}> If you are talking about two databases in the same DMBS environment, then its possible.Like if you have two databases in two different oracle environments, I mean both the database are oracle database; and you want to access the tables of the other database then its possible through dblink. Suppose..Table1 is in database1Table2 is in database2 Log in to database1 and issue queryselect * from table1; //this would work because the table is in same database. Now create dblink (in database1) for database2 as dblink_db2issue query select * from table2@dblink_db2 This would fetch the records from table2 of database2 ( despite the fact that you are logged in database1). Link to comment Share on other sites More sharing options...
Selacius Posted March 22, 2006 Author Share Posted March 22, 2006 Actually, I solved my problem. I ran a query in phpmyadmin which copied a table from one database to another. Then I modified the resulting query to match the columns that were required for both the SELECT and INSERT. My main problem was I wasn't sure how to define the two different databases in the INSERT SELECT mysql query. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now