BookmarkSubscribeRSS Feed
JediApprentice
Pyrite | Level 9

I'm using the SAS/Teradata pass-through facility to create a volatile table and then insert data into it from a table in the WORK library. My work table has one field (my_var) and two rows with the values 'foo' and 'bar' called work.test_file. As you can see I use a global connection in the libref and connection strings. My query is as follows:

 

libname x teradata tdpid=myDBC authdomain="teraauth" mode=teradata connection=global; /* dbmstemp=yes */

proc sql;
  connect to teradata (tdpid=myDBC authdomain="teraauth" mode=teradata connection=global bulkload=yes);
  execute (CREATE VOLATILE TABLE my_vol_tbl (my_var char)
	       ON COMMIT PRESERVE ROWS
          ) by teradata;
quit;

proc sql;
  connect to teradata (tdpid=myDBC authdomain="teraauth" mode=teradata connection=global bulkload=yes);
  execute (INSERT INTO my_vol_tbl SELECT * FROM work.test_file) by teradata;
quit;

data final_test_tbl;
   set x.my_vol_tbl;
   put _all_;
run;

libname x clear;

The creation of the volatile table works. The error occurs under where I try to INSERT INTO my_vol_tbl SELECT * FROM work.test_file:

 

33 execute (INSERT INTO my_temp_tbl SELECT * FROM work.test_file) by teradata;
ERROR: Teradata execute: Syntax error, expected something like a name or a Unicode delimited identifier or an 'UDFCALLNAME' keyword
or '(' between the 'FROM' keyword and the 'work' keyword.

 

 

Thanks

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

You are sending code to Teradata asking it to use table WORK.TESTFILE.

Teradata cannot see this table.

 

Try:

 

proc append base=X.MY_VOL_TBL data=WORK.TESTFILE;
run;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 4008 views
  • 0 likes
  • 2 in conversation