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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Context Variable As Source SQL filter

Hi,
I have a context variable PERIOD_YEAR and when I am using this variable in my source input SQL as below.
"SELECT C1,C2 FROM <ABC> WHERE PERIOD_YEAR = '"+context.PERIOD_YEAR"'"
when I am executing my ETL job, 'tOracleInput' object is throwing error as below 
ERROR:
'java.sql.SQLSyntaxErrorExecution: ORA-01722: invalid number'
Please provide your input to resolve the issue.
Thanks
Saket Krishna 

Labels (2)
1 Reply
Anonymous
Not applicable

You need to remove the single quotes from around the value held by the context variable. So instead of this....
"SELECT C1,C2 FROM <ABC> WHERE PERIOD_YEAR = '"+context.PERIOD_YEAR"'"
....try this....
"SELECT C1,C2 FROM <ABC> WHERE PERIOD_YEAR = "+context.PERIOD_YEAR