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;

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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