<?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: LIBNAME connection to PostgreSQL - Table Listing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147759#M29267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might be missing something but if you say that the libname as such executes successfully then the following code will show you all tables available via schema "Public" (which could be none).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=core._all_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Nov 2013 13:16:14 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2013-11-23T13:16:14Z</dc:date>
    <item>
      <title>LIBNAME connection to PostgreSQL - Table Listing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147757#M29265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to connect to a PostgreSQL database using the LIBNAME statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I'm using:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; core &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;odbc&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;datasrc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'PostGreSQL30'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;schema&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; = Public;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This connects successfully according to the log, but I have no idea what the tables are.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I connect to a Microsoft SQL database I use &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;schema&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; = dbo &lt;/SPAN&gt; and in Enterprise Guide, the library is expandable and I can see the tables and I know what to query/interogate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The obvious answer is to ask the DBA as to what tables are available, but he's not here.&amp;nbsp; Is there a way that I can setup the library such that I can see the contents?&amp;nbsp; I would want this feature even if the DBA could give me a listing of all the tables available. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are on Enterprise Guide 5.1 (5.100.0.12269) Hot fix 7 (32-bit), and SAS 9.3 (TS1M2), Rev. 930_12w41, on Windows Server 2008 64 bit R2 SP1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 23:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147757#M29265</guid>
      <dc:creator>JohnT</dc:creator>
      <dc:date>2013-11-18T23:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME connection to PostgreSQL - Table Listing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147758#M29266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It are not the tables in a DBMS you are refering to but to containers, the schemas, that contain those tables.&lt;/P&gt;&lt;P&gt;Within SAS I do not knon an option to see the schema-s. &lt;BR /&gt;One excpeption was the ODBC interface missing the schema name as using SAS/Share.&amp;nbsp; As SAS/SHare is SAS is not useful info.&lt;/P&gt;&lt;P&gt;There are a lot of developers tools like SQL developer that will show the Schema-names when being autorized&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Nov 2013 11:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147758#M29266</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-11-23T11:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME connection to PostgreSQL - Table Listing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147759#M29267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might be missing something but if you say that the libname as such executes successfully then the following code will show you all tables available via schema "Public" (which could be none).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=core._all_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Nov 2013 13:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147759#M29267</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-11-23T13:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME connection to PostgreSQL - Table Listing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147760#M29268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my log:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13853286284755600" jivemacro_uid="_13853286284755600"&gt;
&lt;P&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libname core odbc datasrc = 'PostGreSQL30' schema = report_target;&lt;BR /&gt;NOTE: Libref CORE was successfully assigned as follows: &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODBC &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Physical Name: PostGreSQL30&lt;BR /&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc contents data=core._all_;&lt;BR /&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;NOTE: Due to the PRESERVE_TAB_NAMES=NO libname option setting, 9 table(s) have not been displayed/returned.&lt;BR /&gt;WARNING: No matching members in directory.&lt;BR /&gt;NOTE: PROCEDURE CONTENTS used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.14 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get nothing in the results tab when I run this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said that, this is the first time I've paid attention to the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've successfully done it !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="padding-left: 30px; font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; core &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;odbc&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;datasrc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'PostGreSQL30'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;schema&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; = report_target &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;PRESERVE_TAB_NAMES&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=yes;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;contents&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=core._all_ ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;And now I can see the datasets in the CORE library.&amp;nbsp; I wonder why I never noticed the hint in the log when I was originally trying to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Nov 2013 21:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-connection-to-PostgreSQL-Table-Listing/m-p/147760#M29268</guid>
      <dc:creator>JohnT</dc:creator>
      <dc:date>2013-11-24T21:29:24Z</dc:date>
    </item>
  </channel>
</rss>

