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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to execute the Select statement stored in variable?

I have a table where I've stored the queries.

Table SQL_QUERY

ID, QUERY
1,SELECT * FROM EMPLOYEE
2,SELECT * FROM DEPARTMENT

//Now I am Looping this table -
for vLoopNumber = 1 to NoOfRows('SQL_QUERY')
  Let vSQL = FieldValue('SQL_QUERY',$(vLoopNumber));   // it fetches the Query

  // Now I want to load the FieldValue('SQL_QUERY',$(vLoopNumber)) i.e resultset of query in table. 

        Table:
        LOAD *;
vSQL ;  // here I want to execute the Select statement stored in variable vSQL.

Next vLoopNumber


---
Please let me know how to execute the Select statement stored in variable vSQL.

Regards
Nilesh

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Try $(vSQL) instead of vSQL ;

View solution in original post

2 Replies
whiteline
Master II
Master II

Try $(vSQL) instead of vSQL ;

Not applicable
Author

Thank you very much!

Regards

Nilesh