<?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: Accessing Oracle tables via ODBC in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/74#M74</link>
    <description>I recently had success with question two using JSL.  First, make a list of your table names, enclosed in curly braces.&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;TableList&lt;/B&gt; = {"003", "004", "005", "Table6", "Table 34", ...}; &lt;BR /&gt;&lt;BR /&gt;Then, use a for-loop to step through the table list, constructing a query that you can feed to the "Open Database" command that you've already found.  I can't paste the code because this message board interprets some of it as HTML and make it look funny.&lt;BR /&gt;&lt;BR /&gt;---------------------------------------------------------------------------------&lt;BR /&gt;For(  -insert for loop conditions here-  //step through the list and concatenate query&lt;BR /&gt;	&lt;B&gt;NewQuery&lt;/B&gt; = "SELECT DATE, FIELD from " || &lt;B&gt;TableList&lt;X&gt;&lt;/X&gt;&lt;/B&gt; ||  " where  FIELD &amp;lt; 1;";&lt;BR /&gt;	&lt;BR /&gt;	currentDT = Open Database( "DSN=*****;UID=*****;PWD=*****;DBQ=*****, etc;", NewQuery);&lt;BR /&gt;---------------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Sorry that looks so messy, but hopefully you get the idea.&lt;BR /&gt;&lt;BR /&gt;To do this within the database, you would need to use 50 JOIN statements in your SQL query.  Do each of the tables share a common field?</description>
    <pubDate>Thu, 05 Feb 2009 13:56:31 GMT</pubDate>
    <dc:creator>afterword</dc:creator>
    <dc:date>2009-02-05T13:56:31Z</dc:date>
    <item>
      <title>Accessing Oracle tables via ODBC</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/73#M73</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm new to JMP and need to go into an Oracle database and turn about 50 tables into JMP tables using JSL.&lt;BR /&gt;&lt;BR /&gt;I've found and can use the OPEN DATABASE command, but have several questions:&lt;BR /&gt;&lt;BR /&gt;1) Once you've opened the database, how do you disconnect from it at the end?&lt;BR /&gt;&lt;BR /&gt;2) The OPEN DATABASE Command accepts an SQL statement and a JMP table name.  How do you get data from 50 tables and put them into 50 JMP tables?  Use 50 OPEn DATABASE commands or is there another way to execute SQL to get data?&lt;BR /&gt;&lt;BR /&gt;Thanks for your help</description>
      <pubDate>Thu, 05 Feb 2009 02:10:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/73#M73</guid>
      <dc:creator />
      <dc:date>2009-02-05T02:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Oracle tables via ODBC</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/74#M74</link>
      <description>I recently had success with question two using JSL.  First, make a list of your table names, enclosed in curly braces.&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;TableList&lt;/B&gt; = {"003", "004", "005", "Table6", "Table 34", ...}; &lt;BR /&gt;&lt;BR /&gt;Then, use a for-loop to step through the table list, constructing a query that you can feed to the "Open Database" command that you've already found.  I can't paste the code because this message board interprets some of it as HTML and make it look funny.&lt;BR /&gt;&lt;BR /&gt;---------------------------------------------------------------------------------&lt;BR /&gt;For(  -insert for loop conditions here-  //step through the list and concatenate query&lt;BR /&gt;	&lt;B&gt;NewQuery&lt;/B&gt; = "SELECT DATE, FIELD from " || &lt;B&gt;TableList&lt;X&gt;&lt;/X&gt;&lt;/B&gt; ||  " where  FIELD &amp;lt; 1;";&lt;BR /&gt;	&lt;BR /&gt;	currentDT = Open Database( "DSN=*****;UID=*****;PWD=*****;DBQ=*****, etc;", NewQuery);&lt;BR /&gt;---------------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Sorry that looks so messy, but hopefully you get the idea.&lt;BR /&gt;&lt;BR /&gt;To do this within the database, you would need to use 50 JOIN statements in your SQL query.  Do each of the tables share a common field?</description>
      <pubDate>Thu, 05 Feb 2009 13:56:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/74#M74</guid>
      <dc:creator>afterword</dc:creator>
      <dc:date>2009-02-05T13:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Oracle tables via ODBC</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/75#M75</link>
      <description>Thanks.&lt;BR /&gt;&lt;BR /&gt; So what you are saying is that the only way to issue SQL to a database is via OPEN DATABASE.  Does this connect and disconnect each time from the database each time it is issued?</description>
      <pubDate>Thu, 05 Feb 2009 14:34:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/75#M75</guid>
      <dc:creator />
      <dc:date>2009-02-05T14:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Oracle tables via ODBC</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/76#M76</link>
      <description>I could be wrong, but I think the Open Database command is more like an "Open Database Table" function.  It queries the database and dumps the data to a table.  It's not a live-view of the data, so I don't think it takes up database resources when its idle even if it maintains a connection.&lt;BR /&gt;&lt;BR /&gt;Hopefully the developers can tell you more.</description>
      <pubDate>Thu, 05 Feb 2009 17:37:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/76#M76</guid>
      <dc:creator>afterword</dc:creator>
      <dc:date>2009-02-05T17:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Oracle tables via ODBC</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/77#M77</link>
      <description>I have soemthing similar here. I need to select 6 weeks of data from sql server each week separately.&lt;BR /&gt;For Eg,&lt;BR /&gt;Week 1 wud be Jan 3 to Jan 9. Week 2 wud be Jan 10 to jan 16 and so on.&lt;BR /&gt;&lt;BR /&gt;I have variables for startdate, enddate, monthvar and yearvar.&lt;BR /&gt;To start with let startdate = 3 and enddate = 9&lt;BR /&gt;monthvar = 1 and yearvar = 2010&lt;BR /&gt;&lt;BR /&gt;my select statement wud be &lt;BR /&gt;select *&lt;BR /&gt;from table1&lt;BR /&gt;where (date &amp;gt; startdate and startdate &amp;lt; enddate) and &lt;BR /&gt;        month = monthvar and&lt;BR /&gt;        year  = yearvar;&lt;BR /&gt;&lt;BR /&gt;How do I pass these variables in Open database statement?</description>
      <pubDate>Tue, 23 Feb 2010 21:21:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/77#M77</guid>
      <dc:creator />
      <dc:date>2010-02-23T21:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Oracle tables via ODBC</title>
      <link>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/78#M78</link>
      <description>I use Sybase, not Oracle, but:&lt;BR /&gt;&lt;BR /&gt;dt=Open Database(&lt;BR /&gt;"DSN=Sybase;SRVR=servername;DB=dbname;UID=userid; PASSWORD=password",&lt;BR /&gt;"select *&lt;BR /&gt;from table1&lt;BR /&gt;where (date &amp;gt; startdate and startdate &amp;lt; enddate) and &lt;BR /&gt;month = monthvar and&lt;BR /&gt;year = yearvar;" );&lt;BR /&gt;&lt;BR /&gt;Message was edited by: mfisher</description>
      <pubDate>Sun, 28 Feb 2010 13:50:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accessing-Oracle-tables-via-ODBC/m-p/78#M78</guid>
      <dc:creator>mfisher</dc:creator>
      <dc:date>2010-02-28T13:50:24Z</dc:date>
    </item>
  </channel>
</rss>

