DATA Step, Macro, Functions and more

Access Volatile Teradata Table

Accepted Solution Solved
Reply
Regular Contributor
Posts: 183
Accepted Solution

Access Volatile Teradata Table

I want to access volatile teradata table in SAS. I am able to create the volatile table using the following code :

 

proc sql;
 connect to teradata (user="youruserid" password="yourpassword" mode=teradata  server="servername" connection=global);
 execute(
 create volatile table temp as (
 select id
 , region
 , sector
 , income
 from ls_policy_inter
 group by 1,2
 )
 with data primary index (id)
 on commit preserve rows
 ) by teradata;
quit;

So if i need to use the table created in the above code in the subsequent code. I can access only permanent teradata table.

 


Accepted Solutions
Solution
‎09-09-2016 03:31 PM
Super User
Super User
Posts: 7,036

Re: Access Volatile Teradata Table

[ Edited ]

Before you create your volatile table first create a libref using the same connection details, including the CONNECTION=GLOBAL setting, and include the DBMSTEMP=YES option.

libname tdwork teradata user="youruserid" password="yourpassword" 
    mode=teradata  server="servername" 
    connection=global dbmstemp=yes
;

Then from SAS you can view the volatile table your SQL code generated as TDWORK.TEMP.  You will also be able to see the tables from future PROC SQL steps (that use the same connection details). 

 

Leave that libref active for as long as you want to be able to view your volatile tables.

 

 

View solution in original post


All Replies
Super User
Posts: 3,250

Re: Access Volatile Teradata Table

Solution
‎09-09-2016 03:31 PM
Super User
Super User
Posts: 7,036

Re: Access Volatile Teradata Table

[ Edited ]

Before you create your volatile table first create a libref using the same connection details, including the CONNECTION=GLOBAL setting, and include the DBMSTEMP=YES option.

libname tdwork teradata user="youruserid" password="yourpassword" 
    mode=teradata  server="servername" 
    connection=global dbmstemp=yes
;

Then from SAS you can view the volatile table your SQL code generated as TDWORK.TEMP.  You will also be able to see the tables from future PROC SQL steps (that use the same connection details). 

 

Leave that libref active for as long as you want to be able to view your volatile tables.

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1396 views
  • 2 likes
  • 3 in conversation