Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
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

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

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!