Unable to Call Stored Procedure from Teradata to SAS

Reply
Senior User
Posts: 1

Unable to Call Stored Procedure from Teradata to SAS

[ Edited ]

 

I tried calling the stored procedure from Teradata to SAS. But I was getting an error as Invalid session mode. Can anyone help me with this error?

 

Below is the code and error:

 
 
proc sql;
connect to teradata as tera(user = testuser pass= testpass tpid="XXXXX" connection=global);
 Create table work.sasresult as
         Select * from connection to tera(call dbname.spname('2016-01-15','2016-01-30','IND',?,?));
disconnect from tera;
quit;
 
 
ERROR: Teradata prepare: Invalid Session Mode for procedure execution. SQL statement was Call dbname.spname('2016-01-15','2016-01-30','IND',?,?);
 
 
Any suggestions or guidance would be greatly appreciated.
 
Thank you.

 

 

Contributor
Posts: 32

Re: Unable to Call Stored Procedure from Teradata to SAS

To use a Teradata Stored Procedure (or any DBMS Stored Procedure) you need to do it as a CALL EXECUTE, and the results would be a Teradata temporary table (or Global Temporary table, or some kind of scratch table).  You would then use Create table work.sasresult as  Select * from connection  ... to read that table into SAS.

Ask a Question
Discussion stats
  • 1 reply
  • 154 views
  • 0 likes
  • 2 in conversation