<?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: Getting database names from dictionary metadata of Snowflake library references. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737756#M230023</link>
    <description>&lt;P&gt;First get rid of the WHERE clause (or just filter on LIBNAME) so that you can see what is stored.&amp;nbsp; Different engines will store different information (and different language settings will change how the values are stored also).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What engine are you using the connect to Snowflake?&amp;nbsp; Does SAS have a specific engine for it (like ORACLE or TERADATA)? Or are you using e generic connection (like ODBC).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you research if there is a SQL query you can push into the Snowflake database to tell you what your default schema/database is for your current session?&amp;nbsp; Does&amp;nbsp; Snowflake even have such a concept?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2021 22:53:46 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-04-28T22:53:46Z</dc:date>
    <item>
      <title>Getting database names from dictionary metadata of Snowflake library references.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737748#M230017</link>
      <description>&lt;P&gt;I'm trying in DI user-written transformations to automagically generate SQL&amp;nbsp;&lt;EM&gt;connect&lt;/EM&gt; clauses from&amp;nbsp;&lt;EM&gt;libname&amp;nbsp;&lt;/EM&gt;statements. In other DBMSs, I pick out the schema information from &lt;EM&gt;dictionary.libnames&lt;/EM&gt; (&lt;I&gt;where&amp;nbsp;sysname like 'Schema%'&lt;/I&gt;). This works for Snowflake too, but there's no row in&amp;nbsp;&lt;EM&gt;libnames&lt;/EM&gt; for anything like&amp;nbsp;&lt;I&gt;sysname like 'Database%'.&amp;nbsp;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I productionise this code, the schema name is likely to stay the same but the database name will change, and so I want the process to be dynamic. Has anyone had any experience doing this?&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737748#M230017</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2021-04-28T22:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Getting database names from dictionary metadata of Snowflake library references.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737756#M230023</link>
      <description>&lt;P&gt;First get rid of the WHERE clause (or just filter on LIBNAME) so that you can see what is stored.&amp;nbsp; Different engines will store different information (and different language settings will change how the values are stored also).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What engine are you using the connect to Snowflake?&amp;nbsp; Does SAS have a specific engine for it (like ORACLE or TERADATA)? Or are you using e generic connection (like ODBC).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you research if there is a SQL query you can push into the Snowflake database to tell you what your default schema/database is for your current session?&amp;nbsp; Does&amp;nbsp; Snowflake even have such a concept?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737756#M230023</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-28T22:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting database names from dictionary metadata of Snowflake library references.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737757#M230024</link>
      <description>&lt;P&gt;I've done it without the where clause, and that doesn't help. It provides &lt;EM&gt;Schema, Server Version &lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;Client Version&lt;/EM&gt; only.&amp;nbsp;I'm using &lt;EM&gt;SASIOSNF&lt;/EM&gt;, which I think is either ODBC or JDBC.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And remember I'm trying to programatically generate the sql connect clause, so that I am able to then execute pass-through code - cart before the horse, sadly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737757#M230024</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2021-04-28T22:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting database names from dictionary metadata of Snowflake library references.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737758#M230025</link>
      <description>&lt;P&gt;I would forget the horse and buggy and get a car instead.&lt;/P&gt;
&lt;P&gt;Just the CONNECT USING statement in PROC SQL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect using mylib ;
select * from connection to mylib
(  ... snowflake code here ...)
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Apr 2021 23:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737758#M230025</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-28T23:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting database names from dictionary metadata of Snowflake library references.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737761#M230028</link>
      <description>&lt;P&gt;Getting a car to replace the horse and buggy would be a bit of A Mishion…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it worked. Genius. I've been using connect clauses for 25 years, and I didn't know about that syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I owe you a beer, when you're allowed to enter Aotearoa.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 23:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-database-names-from-dictionary-metadata-of-Snowflake/m-p/737761#M230028</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2021-04-28T23:09:49Z</dc:date>
    </item>
  </channel>
</rss>

