Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ramyasaiqv
Creator II
Creator II

Variable not working as expected

Hello Community,

Hope everyone is doing well during these difficult times. I am working on switching a connection from default/public schema to a new schema within the same database, but the variables defined are not working as expected. The connection variables are working fine against the default schema but when I switch to the new schema it is throwing following error message. Below are the variable definitions, any inputs on what the issues on these variables could be greatly appreciated. Thank you,

Error message:

“Connector reply error: SQL##f - SqlState: 42P01, ErrorCode: 30, ErrorMsg: [Qlik][Amazon Redshift] (30) Error occurred while trying to execute a query: [SQLState 42P01] ERROR: relation "dim_time" does not exist : SQL SELECT”

 

Let vSQL = 'SELECT $(vFieldList) FROM $(SchemaName)$(vCurrentTable)$(vWhereClause)' ;

    let vTable = PurgeChar('$(vCurrentTable)', '[] ');

    let vFull_QVD_Name = '$(vQVD_Path)/$(vTable)_Extract.qvd';

   

    $(vCurrentTable):

    Load RecNo() as %RecordId, *

    ;

   SQL $(vSQL);               // erroring out here

   

    Store $(vCurrentTable) into [$(vFull_QVD_Name)](qvd);

1 Solution

Accepted Solutions
ramyasaiqv
Creator II
Creator II
Author

i have figured it out, the issue is with the $(SchemaName), i modified the variable and it worked. Thank you, 

View solution in original post

3 Replies
ArnadoSandoval
Specialist II
Specialist II

Hi @ramyasaiqv 

Thank you for the good advice; it seems you got a connection already and it is returning an error message complaining about the variable "dim_time" does not exist  as you switched to a different schema, Would it be possible the new schema is out of sync with the public's one?

Hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
ramyasaiqv
Creator II
Creator II
Author

Hi Arnaldo,

Thank you for the response. The “dim_time” table does exist in the new schema but not in the default schema. Even though I am pointing to new schema it looks like qlik is still connecting to the default schema which “dim_time” does not exist. I suspect the below variable is causing the issue. I tried playing around changing the syntax for the below variable but I am not having any luck.

 

Let vSQL = 'SELECT $(vFieldList) FROM $(SchemaName)$(vCurrentTable)$(vWhereClause)' 

Thank you,

Ramya

ramyasaiqv
Creator II
Creator II
Author

i have figured it out, the issue is with the $(SchemaName), i modified the variable and it worked. Thank you,