Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use a variable instead of a Query/ Proc

Hi,

I am trying to pass a variable with procedure instead of direct execute statement.

Qlick Query.png

I can see the statement loaded in the variable, but the EXEC statement is not working.

ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Could not find stored procedure 'Query'.

QueryResult:

SQL EXEC Query

Please help!

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You need this to set the variable correctly:

SET vDynamicQuery = peek('Query',0,'QueryTable');


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You need this to set the variable correctly:

SET vDynamicQuery = peek('Query',0,'QueryTable');


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you Gysbert!