<?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 vs sql pass thru in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707601#M217273</link>
    <description>&lt;P&gt;A LIBNAME statement connecting to an external database versus an SQL Passthru doing the same - both have advantages and disadvantages:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAMEs are easier and can be automated for all SAS sessions via SAS metadata or SAS AUTOEXECs but can't handle table names greater than 32 characters long. They can be directly used in DATA steps and many SAS procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL Passthru is more powerful, more customisable, and is the only way to access table names greater than 32 characters long, but you need to know the SQL syntax of the database you are querying and can only be used in PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2020 02:41:02 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-12-22T02:41:02Z</dc:date>
    <item>
      <title>Libname vs sql pass thru</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707385#M217185</link>
      <description>What is difference between&lt;BR /&gt;Libname statement and sql pass thru query</description>
      <pubDate>Mon, 21 Dec 2020 09:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707385#M217185</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-12-21T09:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Libname vs sql pass thru</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707417#M217198</link>
      <description>Libname statement need translate sas sql into local sql,&lt;BR /&gt;while pass thru don't , just pass local sql into DB and run sql at DB side ,so it is faster then libname .</description>
      <pubDate>Mon, 21 Dec 2020 12:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707417#M217198</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-12-21T12:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Libname vs sql pass thru</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707601#M217273</link>
      <description>&lt;P&gt;A LIBNAME statement connecting to an external database versus an SQL Passthru doing the same - both have advantages and disadvantages:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAMEs are easier and can be automated for all SAS sessions via SAS metadata or SAS AUTOEXECs but can't handle table names greater than 32 characters long. They can be directly used in DATA steps and many SAS procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL Passthru is more powerful, more customisable, and is the only way to access table names greater than 32 characters long, but you need to know the SQL syntax of the database you are querying and can only be used in PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 02:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707601#M217273</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-12-22T02:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Libname vs sql pass thru</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707604#M217276</link>
      <description>&lt;P&gt;This is a badly worded question.&lt;/P&gt;
&lt;P&gt;Libnames enable a connection. SQL (passthru or not) can use the connection to access data.&lt;/P&gt;
&lt;P&gt;So they are not mutually exclusive. They don't do the same thing.&lt;/P&gt;
&lt;P&gt;This means that they be used together:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname ORADATA oracle user= ....;
proc sql;
  connect using ORADATA;
  select * from (        /* Use SAS SQL before the (         */
     select * from ...   /* Use Oracle SQL between ( and  )  */
  ) ;                    /* Use SAS SQL after the (          */
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Dec 2020 03:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Libname-vs-sql-pass-thru/m-p/707604#M217276</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-12-22T03:19:55Z</dc:date>
    </item>
  </channel>
</rss>

