Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Variable in schema SQL Statement

Hi,

What is the correct statement, i see an error message... 

LET vTableSchema ='Appollon';

LOAD TABLE_NAME AS TableNames;
SELECT DISTINCT TABLE_NAME FROM information_schema.tables
WHERE table_schema=$(vTableSchema)  AND TABLE_NAME IN (
'countries', 'adventures_professionnal');

 

Regards,

Labels (1)
1 Solution

Accepted Solutions
Highlighted

Another alternative to Vegar's response is changing your LET to SET--then the single quotes will stay within the variable and you don't need to add them in the SQL.

View solution in original post

2 Replies
Highlighted
Partner
Partner

My best guess is that you need quotes around your variable expansion. Like this:

... 

WHERE table_schema='$(vTableSchema)' 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted

Another alternative to Vegar's response is changing your LET to SET--then the single quotes will stay within the variable and you don't need to add them in the SQL.

View solution in original post