<?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: Create Volatile Table in Teradata Using ODBC in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818584#M323111</link>
    <description>&lt;P&gt;And how did you check whether the table was there?&lt;/P&gt;
&lt;P&gt;Did you include the photograph because you thought the GUI would show the volatile tables.&amp;nbsp; I don't think that is a reasonable thing to expect.&amp;nbsp; To test if the table is there query it.&amp;nbsp; Query with pass through Teradata code.&amp;nbsp; Try to query it via your SAS libref.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2022 14:29:55 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-06-16T14:29:55Z</dc:date>
    <item>
      <title>Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818247#M322986</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create volatile table in Teradata using ODBC as I do not have license to access the Teradata engine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the Teradata SQL query I am using in SAS:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;CREATE&lt;/SPAN&gt; &lt;SPAN&gt;VOLATILE&lt;/SPAN&gt; &lt;SPAN&gt;TABLE&lt;/SPAN&gt; &lt;SPAN&gt;base_acct_extract&lt;/SPAN&gt;&lt;SPAN&gt;
(
&lt;/SPAN&gt;&lt;SPAN&gt;account_id&lt;/SPAN&gt; &lt;SPAN&gt;varchar&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;30&lt;/SPAN&gt;&lt;SPAN&gt;)
)
&lt;/SPAN&gt;&lt;SPAN&gt;PRIMARY&lt;/SPAN&gt; &lt;SPAN&gt;INDEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;account_id&lt;/SPAN&gt;&lt;SPAN&gt;)
&lt;/SPAN&gt;&lt;SPAN&gt;ON&lt;/SPAN&gt; &lt;SPAN&gt;COMMIT&lt;/SPAN&gt; &lt;SPAN&gt;PRESERVE&lt;/SPAN&gt; &lt;SPAN&gt;ROWS&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;


&lt;SPAN&gt;INSERT&lt;/SPAN&gt; &lt;SPAN&gt;INTO&lt;/SPAN&gt; &lt;SPAN&gt;base_acct_extract&lt;/SPAN&gt; &lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;'ABC1200'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Can I even use the ODBC engine to create a volatile table? If so, how do I &lt;STRONG&gt;create&lt;/STRONG&gt; and &lt;STRONG&gt;access&lt;/STRONG&gt; the table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;NT&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 03:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818247#M322986</guid>
      <dc:creator>sasmaverick</dc:creator>
      <dc:date>2022-06-15T03:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818277#M322995</link>
      <description>Sorry. I can't help you. Maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt; could give you a hand.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Access-Volatile-Teradata-Table/m-p/293573" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Access-Volatile-Teradata-Table/m-p/293573&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-load-data-to-volatile-table-in-teradata/m-p/697498" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-load-data-to-volatile-table-in-teradata/m-p/697498&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Can-SAS-code-create-an-index-on-a-volatile-table-in-Teradata/m-p/275835#U275835" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Can-SAS-code-create-an-index-on-a-volatile-table-in-Teradata/m-p/275835#U275835&lt;/A&gt;</description>
      <pubDate>Wed, 15 Jun 2022 11:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818277#M322995</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-06-15T11:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818300#M323005</link>
      <description>&lt;P&gt;SAS/ACCESS to ODBC has support for temporay tables:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0irpkyp22l7vzn1il9lx6f4wmx9.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0irpkyp22l7vzn1il9lx6f4wmx9.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the exmple&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;posted should work, but replace teradata with odbc as engine.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Access-Volatile-Teradata-Table/m-p/293573" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Access-Volatile-Teradata-Table/m-p/293573&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 13:30:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818300#M323005</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-06-15T13:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818335#M323013</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/27005"&gt;@sasmaverick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create volatile table in Teradata using ODBC as &lt;STRONG&gt;I do not have license to access the Teradata engine.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You do require permissions and access on the Teradata server to be able to do this. When you say you do not have a license to access the Teradata engine, does that mean you don't have the SAS license for a Teradata ODBC driver?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 15:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818335#M323013</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-15T15:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818481#M323069</link>
      <description>&lt;P&gt;If you are using SAS/ACCESS to ODBC, something like this should work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname teradata odbc noprompt = "&amp;lt;Put your Teradata connection string here&amp;gt;";

proc sql;
 connect using teradata;
 execute(
 CREATE VOLATILE TABLE base_acct_extract
(
account_id varchar(30)
)
PRIMARY INDEX(account_id)
ON COMMIT PRESERVE ROWS;

INSERT INTO base_acct_extract VALUES ('ABC1200');
)
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Edit: As long as you don't clear the LIBNAME, the Teradata database connection should remain active and the volatile table remain available. That's my best guess anyway as I've never used Teradata but I assume they work similarly to temporary tables in other RDBMSs.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 02:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818481#M323069</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-16T02:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818514#M323082</link>
      <description>&lt;P&gt;I think I was able to create the volatile table using the below syntax. Thanks to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;for the inspiration.&amp;nbsp; &lt;STRONG&gt;However, I am not sure how to access this table in SAS now?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*create volatile table*/
proc sql;
 CONNECT TO ODBC AS TDP5 (DSN="TDP5DBC" UID="&amp;amp;NT_UID." PWD="&amp;amp;NT_PWD." );
 execute(
 create volatile table temp as (
 select top 10 * from teralib.customers
 )
 with data primary index (Cust_ID)
 on commit preserve rows
 ) by TDP5;
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 03:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818514#M323082</guid>
      <dc:creator>sasmaverick</dc:creator>
      <dc:date>2022-06-16T03:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818515#M323083</link>
      <description>&lt;P&gt;You need to use one connection that stays open.&amp;nbsp; Otherwise Teradata will erase the temporary tables when the connection closes.&lt;/P&gt;
&lt;P&gt;Make a LIBREF and then use that for everything.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname td odbc .... connection details ... ;
proc sql;
connect using td;
execute by td 
( create volatile table .... )
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure to include the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/p0he4t6yjfmkhpn16qrf0cdhllu6.htm" target="_self"&gt;DBMSTEMP=yes&lt;/A&gt;&amp;nbsp;option.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 03:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818515#M323083</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-16T03:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818519#M323085</link>
      <description>&lt;P&gt;I am using the below code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*create volatile table*/

libname td odbc dsn = "TDP5DBC" uid = &amp;amp;my_uid. pwd = &amp;amp;my_pwd.  
    connection=global dbmstemp=yes;

proc sql;
 connect using td;
 execute by td(create volatile table temp as (
 select top 10 * from teralib.customers
 )
 with data primary index (cust_id)
 on commit preserve rows);
quit;&lt;/PRE&gt;
&lt;P&gt;However, still nothing seems to be created in TD:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sasmaverick_0-1655351408616.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72360iCEE7C91CBB23C9A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sasmaverick_0-1655351408616.png" alt="sasmaverick_0-1655351408616.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 03:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818519#M323085</guid>
      <dc:creator>sasmaverick</dc:creator>
      <dc:date>2022-06-16T03:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818520#M323086</link>
      <description>&lt;P&gt;Did you refresh the TD library after running the CREATE TABLE? Do you have access to a Teradata tool to independently check if the table gets created or not?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 04:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818520#M323086</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-16T04:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818522#M323087</link>
      <description>&lt;P&gt;Yes I did refresh the TD library in SAS. I have Teradata SQL Assistant. When I use the below code in that, it's able to create the volatile table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;create volatile table temp as (
 select top 10 cust_id from teralib.customers
 )
 with data primary index (cust_id)
 on commit preserve rows&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp; when I run the same code below in SAS, I don't see the table. All I am looking for is the colatile table to be brought into a SAS library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 CONNECT TO ODBC AS TDP5 (DSN="TDP5DBC" UID="&amp;amp;SGB_UID." PWD="&amp;amp;SGB_PWD." connection=global);
 execute(
 create volatile table temp as ( select top 10 cust_id from teralib.customers ) with data primary index (cust_id) on commit preserve rows
 ) by TDP5;
 
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 04:45:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818522#M323087</guid>
      <dc:creator>sasmaverick</dc:creator>
      <dc:date>2022-06-16T04:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818552#M323101</link>
      <description>&lt;P&gt;Try add SCHEMA= option in LIBNAME:&lt;BR /&gt;libname td odbc dsn = "TDP5DBC" uid = &amp;amp;my_uid. pwd = &amp;amp;my_pwd. &lt;BR /&gt;connection=global dbmstemp=yes SCHEMA=xxxxxxx ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you don't know SCHEMA, you could check it by :&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to odbc.....&lt;BR /&gt;select * from connection to odbc(ODBC&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;::&lt;/STRONG&gt;&lt;/FONT&gt;SQLTables);&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 12:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818552#M323101</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-06-17T12:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818584#M323111</link>
      <description>&lt;P&gt;And how did you check whether the table was there?&lt;/P&gt;
&lt;P&gt;Did you include the photograph because you thought the GUI would show the volatile tables.&amp;nbsp; I don't think that is a reasonable thing to expect.&amp;nbsp; To test if the table is there query it.&amp;nbsp; Query with pass through Teradata code.&amp;nbsp; Try to query it via your SAS libref.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 14:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818584#M323111</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-16T14:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create Volatile Table in Teradata Using ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818686#M323151</link>
      <description>&lt;P&gt;How about creating the volatile table using SAS then checking if it exists with&amp;nbsp;&lt;SPAN&gt;Teradata SQL Assistant? I'm able to do this with SQL Server using MS SQL Server Management Studio so I'm thinking it should work in&amp;nbsp;Teradata SQL Assistant. Also try PROC CONTENTS in SAS:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=TD._all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 20:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Volatile-Table-in-Teradata-Using-ODBC/m-p/818686#M323151</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-16T20:01:50Z</dc:date>
    </item>
  </channel>
</rss>

