<?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: Read snowflake table where table name is morethan 32 byte in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838390#M331484</link>
    <description>&lt;P&gt;No need to re-connect to the database if you already have a libref defined that connects to the database.&amp;nbsp; The CONNECT USING syntax allows you to connect using an existing libref.&amp;nbsp; That way you don't have to repeat your credentials again. And also you reduce the load on the database by opening only one connection instead of two.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code used SNOW as the libref for the connection you made to the database that I why I used that name in my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SNOW ......;
proc sql;
connect using SNOW ;
select * from connection to SNOW (...);
execute by SNOW (...);
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Oct 2022 12:28:16 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-10-13T12:28:16Z</dc:date>
    <item>
      <title>Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838278#M331423</link>
      <description>&lt;P&gt;Hi Team,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to access one particular table in snowflake due to the length of the table name is more than 32 byte.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am connecting to Snowflake using libname; could you help me to give some idea on reading this table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let sf_driver=**********************;&lt;BR /&gt;%let sf_account=********************;&lt;BR /&gt;%let sf_server=*********************************;&lt;BR /&gt;%let sf_database=********************;&lt;BR /&gt;%let sf_schema=***************************;&lt;BR /&gt;%let sf_stage=***************;&lt;BR /&gt;%let sf_uid=*******************;&lt;BR /&gt;%let sf_pwd=**************************;&lt;/P&gt;&lt;P&gt;/* libnames for implicit connections */&lt;BR /&gt;libname snow ODBC complete="driver=&amp;amp;sf_driver;uid=&amp;amp;sf_uid;pwd=&amp;amp;sf_pwd;server=&amp;amp;sf_server;database=&amp;amp;sf_database"&lt;BR /&gt;schema=&amp;amp;sf_schema&lt;BR /&gt;autocommit=no&lt;BR /&gt;insertbuff=32767&lt;BR /&gt;readbuff=32767&lt;BR /&gt;preserve_tab_names=yes;&lt;/P&gt;&lt;P&gt;data _1;&lt;BR /&gt;set snow.table_name_where_length_is_more_than_32_byte;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 17:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838278#M331423</guid>
      <dc:creator>saswiki</dc:creator>
      <dc:date>2022-10-12T17:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838289#M331429</link>
      <description>&lt;P&gt;This has been answered before.&amp;nbsp; After first berating the idiot that thinks it a reasonable way to run a computer system to use object names that are so long you just need to switch to using pass thru SQL to access the datasets ("tables") and variables ("columns") with the ridiculous names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect using snow;
create table _1 as select * from connection to snow
  (select name1
        , name2
        , variable_name_where_length_is_more_than_32_bytes as name3
   from table_name_where_length_is_more_than_32_bytes
  )
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Oct 2022 19:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838289#M331429</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-12T19:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838350#M331463</link>
      <description>Thanks for the reply. I have already tried this pass through method but i am getting the below error;&lt;BR /&gt;&lt;BR /&gt;ERROR: The SNOW engine cannot be found.&lt;BR /&gt;ERROR: A Connection to the snow DBMS is not currently supported, or is not installed at your site.&lt;BR /&gt;&lt;BR /&gt;I have used libname to connect with snowflake table first and then using connect statement in PROC SQL to get the column names.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2022 08:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838350#M331463</guid>
      <dc:creator>saswiki</dc:creator>
      <dc:date>2022-10-13T08:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838376#M331479</link>
      <description>&lt;P&gt;If you have a working libref, you can take a shortcut using "USING":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CONNECT USING &lt;EM&gt;libref&lt;/EM&gt; &amp;lt;AS &lt;EM&gt;alias&lt;/EM&gt;&amp;gt;;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2022 12:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838376#M331479</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-10-13T12:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838390#M331484</link>
      <description>&lt;P&gt;No need to re-connect to the database if you already have a libref defined that connects to the database.&amp;nbsp; The CONNECT USING syntax allows you to connect using an existing libref.&amp;nbsp; That way you don't have to repeat your credentials again. And also you reduce the load on the database by opening only one connection instead of two.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code used SNOW as the libref for the connection you made to the database that I why I used that name in my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pattern:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SNOW ......;
proc sql;
connect using SNOW ;
select * from connection to SNOW (...);
execute by SNOW (...);
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2022 12:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838390#M331484</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-13T12:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838404#M331489</link>
      <description>Thanks again.&lt;BR /&gt;&lt;BR /&gt;I have tried with CONNECT USING, but still i am not able to view the table.&lt;BR /&gt;I just want to confirm if it is working for other tables which i can access from snowflake schema, for those also, ths code is not working.&lt;BR /&gt;&lt;BR /&gt;libname snow ODBC complete="driver=&amp;amp;sf_driver;uid=&amp;amp;sf_uid;pwd=&amp;amp;sf_pwd;server=&amp;amp;sf_server;database=&amp;amp;sf_database"&lt;BR /&gt;schema=&amp;amp;sf_schema&lt;BR /&gt;autocommit=no&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect using snow;&lt;BR /&gt;select *&lt;BR /&gt;from connection to snow&lt;BR /&gt;(select *&lt;BR /&gt;from table_name&lt;BR /&gt;);&lt;BR /&gt;disconnect from snow;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;I am getting the below error:&lt;BR /&gt;&lt;BR /&gt;ERROR: CLI prepare error: SQL compilation error: Object 'Table Name' does not exist or not authorized.&lt;BR /&gt;&lt;BR /&gt;Thanks again for your time and help.</description>
      <pubDate>Thu, 13 Oct 2022 13:52:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838404#M331489</guid>
      <dc:creator>saswiki</dc:creator>
      <dc:date>2022-10-13T13:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838405#M331490</link>
      <description>I am able to view the tables in sas libraries, but using the pass through method, it is not working.</description>
      <pubDate>Thu, 13 Oct 2022 13:54:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838405#M331490</guid>
      <dc:creator>saswiki</dc:creator>
      <dc:date>2022-10-13T13:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read snowflake table where table name is morethan 32 byte</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838406#M331491</link>
      <description>&lt;P&gt;You probably need to include the schema name when referencing the table in the pass thru sql.&lt;/P&gt;
&lt;P&gt;Perhaps &amp;amp;sf_schema..table_name ?&lt;/P&gt;
&lt;P&gt;Test the passthru SQL syntax using some other way to run SQL code in Snowflake. Such as the browser based tool that Snowflake has.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other thing to check is the name of the variables in the snowflake dataset.&amp;nbsp; Using SELECT * you are trying to retrieve them as is.&amp;nbsp; If any of those are also not valid SAS names you will have problems.&amp;nbsp; But I would expect a different error message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 14:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-snowflake-table-where-table-name-is-morethan-32-byte/m-p/838406#M331491</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-13T14:04:19Z</dc:date>
    </item>
  </channel>
</rss>

