<?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: Get schema list from ODBC database in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Get-schema-list-from-ODBC-database/m-p/235969#M46544</link>
    <description>&lt;P&gt;This is how I'd do it in Oracle:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dbc = create database connection("&amp;lt;your connection string here&amp;gt;");
sql = "SELECT a.username
  FROM all_users a
 ORDER BY a.USERNAME";
dt = execute sql(dbc, sql, invisible)
close database connection(dbc);
schema_list = dt:username &amp;lt;&amp;lt; get values;
close(dt, nosave);

tbl_list = {};

nw = new window("Schema Browser",
	panel box("Schemas",
		schema_cb = combo box(schema_list,
			one_schema = schema_cb &amp;lt;&amp;lt; get selected;
			sql = evalinsert(
"SELECT a.table_name
   FROM all_tables a
  WHERE a.owner = '^one_schema^'
  ORDER BY 1");
			dbc = create database connection("&amp;lt;your connection string here&amp;gt;");
			dt = execute sql(dbc, sql, invisible)
			close database connection(dbc);
			tbl_list = dt:table_name &amp;lt;&amp;lt; get values;
			tbl_lb &amp;lt;&amp;lt; set items(tbl_list);
			close(dt, nosave);
		),
	),
	panel box("Schema Tables",
		tbl_lb = list box(tbl_list, width(300), nlines(20))
	),
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Nov 2019 14:47:37 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2019-11-21T14:47:37Z</dc:date>
    <item>
      <title>Get schema list from ODBC database</title>
      <link>https://community.jmp.com/t5/Discussions/Get-schema-list-from-ODBC-database/m-p/235928#M46537</link>
      <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im about to make a script, that fetches tables from an ODBC database. I have managed to use the query builder to do this, but I need to be able to select a schema from a drop down list, as not all users will have access to all schemas. Can anyone help me with an example on how to get the available schemas as a list or similar? It doesnt need to exclusively be the schemas the user has access to, but just all the schemas in the database. As an extra issue, it would be cool if I could get a list of tables that all have a specific view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Br. Anders&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 13:52:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-schema-list-from-ODBC-database/m-p/235928#M46537</guid>
      <dc:creator>AWMN</dc:creator>
      <dc:date>2019-11-21T13:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get schema list from ODBC database</title>
      <link>https://community.jmp.com/t5/Discussions/Get-schema-list-from-ODBC-database/m-p/235969#M46544</link>
      <description>&lt;P&gt;This is how I'd do it in Oracle:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dbc = create database connection("&amp;lt;your connection string here&amp;gt;");
sql = "SELECT a.username
  FROM all_users a
 ORDER BY a.USERNAME";
dt = execute sql(dbc, sql, invisible)
close database connection(dbc);
schema_list = dt:username &amp;lt;&amp;lt; get values;
close(dt, nosave);

tbl_list = {};

nw = new window("Schema Browser",
	panel box("Schemas",
		schema_cb = combo box(schema_list,
			one_schema = schema_cb &amp;lt;&amp;lt; get selected;
			sql = evalinsert(
"SELECT a.table_name
   FROM all_tables a
  WHERE a.owner = '^one_schema^'
  ORDER BY 1");
			dbc = create database connection("&amp;lt;your connection string here&amp;gt;");
			dt = execute sql(dbc, sql, invisible)
			close database connection(dbc);
			tbl_list = dt:table_name &amp;lt;&amp;lt; get values;
			tbl_lb &amp;lt;&amp;lt; set items(tbl_list);
			close(dt, nosave);
		),
	),
	panel box("Schema Tables",
		tbl_lb = list box(tbl_list, width(300), nlines(20))
	),
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Nov 2019 14:47:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-schema-list-from-ODBC-database/m-p/235969#M46544</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-11-21T14:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get schema list from ODBC database</title>
      <link>https://community.jmp.com/t5/Discussions/Get-schema-list-from-ODBC-database/m-p/238310#M47075</link>
      <description>Thanks so much, this helped a lot!</description>
      <pubDate>Thu, 12 Dec 2019 07:07:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-schema-list-from-ODBC-database/m-p/238310#M47075</guid>
      <dc:creator>AWMN</dc:creator>
      <dc:date>2019-12-12T07:07:21Z</dc:date>
    </item>
  </channel>
</rss>

