<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL query from 2 or more databases in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16978#M15486</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're using Oracle you can create a database link between the two databases.&amp;nbsp; Then you can select data from both databases simultaneously.&amp;nbsp; I've used database links quite often and they are fairly painless.&amp;nbsp; Might need some help from a DBA to set up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're using SQL server there's something called a linked server that can accomplish the same thing, but I don't have any experience with that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Feb 2016 14:58:42 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2016-02-12T14:58:42Z</dc:date>
    <item>
      <title>SQL query from 2 or more databases</title>
      <link>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16977#M15485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been creating some queries to an SQL database to extract some of the information from a master table and some other linked tables in a database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to be able to create a query that links tables located in two separate databases (both located in the same server) but I do not know if this is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you create a query, the connection seems to be linked to a specific database in a server and NOT to the server itself. This makes the tables available for the query limited to only one of the databases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this correct or am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way around it? I have not tried to create two connections (one per database), would this work/be possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 14:08:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16977#M15485</guid>
      <dc:creator>morenopelaez_p</dc:creator>
      <dc:date>2016-02-12T14:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query from 2 or more databases</title>
      <link>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16978#M15486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're using Oracle you can create a database link between the two databases.&amp;nbsp; Then you can select data from both databases simultaneously.&amp;nbsp; I've used database links quite often and they are fairly painless.&amp;nbsp; Might need some help from a DBA to set up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're using SQL server there's something called a linked server that can accomplish the same thing, but I don't have any experience with that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 14:58:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16978#M15486</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2016-02-12T14:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query from 2 or more databases</title>
      <link>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16979#M15487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks @PMroz , that is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using MySQL so I will investigate what is the equivalent to the "linking" procedures you mention.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 16:12:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16979#M15487</guid>
      <dc:creator>morenopelaez_p</dc:creator>
      <dc:date>2016-02-12T16:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query from 2 or more databases</title>
      <link>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16980#M15488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Echoing PMroz's answer, this is really more of a DBA question.&amp;nbsp; At least as far as querying two databases at once goes.&amp;nbsp; Other wise, you could always query both databases separately and then join/update/concatenate the tables together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;dbhandle1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #0000dd;"&gt;Create Database Connection&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: Consolas;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;info1&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;sql1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;table1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #0000dd;"&gt;Execute SQL&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: Consolas;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;dbhandle1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; sql1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;"Table1"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: Consolas;"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;dbhandle2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #0000dd;"&gt;Create Database Connection&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: Consolas;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;info2&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;sql2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;table2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #0000dd;"&gt;Execute SQL&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: Consolas;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;dbhandle2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; sql2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: purple;"&gt;"Table2"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: Consolas;"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;table1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;Join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;with&lt;STRONG&gt;(&lt;/STRONG&gt;table2&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:06:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16980#M15488</guid>
      <dc:creator>msharp</dc:creator>
      <dc:date>2016-02-12T17:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query from 2 or more databases</title>
      <link>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16981#M15489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks msharp, that was my backup option indeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After doing some research it looks like there is no equivalent to Oracle's "dblink" in MySQL. I still have to try to create a view table from several and call that one database from JMP. That could work as a "summary".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 09:20:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQL-query-from-2-or-more-databases/m-p/16981#M15489</guid>
      <dc:creator>morenopelaez_p</dc:creator>
      <dc:date>2016-02-16T09:20:50Z</dc:date>
    </item>
  </channel>
</rss>

