Start a new topic

2 DB Connection in SQL Commander

[This topic is migrated from our old forums. The original author name has been removed]

I am wondering if there is a way to write in SQL commander connections to (2) Database's at the same time. In other words, say I have Conn1 = MySQLdb and Conn2 = Oracle db and I wanted to write a script like so. Connect Conn1 @export on; @export format="sql" set filename="C:\NoHitList.sql" select * from table 1; Connect Conn2 select * from table 1; @export off; So this would give me a file "C:\NoHitList.sql" that would have the exported SQL from both of the connections?

[This reply is migrated from our old forums.]

Re: 2 DB Connection in SQL Commander
Hi Kurt, You may be able to do this using an H2 database as a bridge, please see this page for details: http://confluence.dbvis.com/pages/viewpage.action?pageId=3146054 In then example, two tables in two different databases are used in one statement, but you can of course select from them one by one as well. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]
[Attachment has been removed.]

Re: 2 DB Connection in SQL Commander
So I gave the H2 embedded connection a try and I have connected to both sources successfully. However I can not query the data? I can open the link tables by right clicking opening it in a new tab, but I can not right sql in the SQL commander to query it? Any idea what I am doing wrong here?
[This reply is migrated from our old forums.]

Re: 2 DB Connection in SQL Commander
Hi Kurt, Since you use a mixed-case table name, you probably have to put it in quotes: SELECT id FROM public."IMSeMember"; Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: 2 DB Connection in SQL Commander
Thank you, That solved my issue.
Login or Signup to post a comment