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: 
Anonymous
Not applicable

Context Variable with Date Parameter : How to use?

Hi all, 

 

I'm having a problem using my context variable in sql builder in tDBInput . 

 

Here is my context variable 

0683p000009MaVv.png

 

Here is how I use the variable in SQL 

WHERE TO_CHAR(CREATE_DT,'YYYY-MM-DD') = TO_CHAR('+context.PARAMETER_DATE+','YYYY-MM-DD')

 

but once I run my job I receive "ORA-01722: invalid number" error. 

 

 

Please help me . Hope you understand what I'm trying to reach out have a great day! 

Labels (3)
1 Reply
manodwhb
Champion II
Champion II

@iMinari17 , the best way to know the what value and the query is passing to io check that in tJava print the query which is trying to use in tdbinput.

 

your query construction would wrong with context variables. something like this you need use check the below.

 

"select * form table WHERE TO_CHAR(CREATE_DT,'YYYY-MM-DD') = TO_CHAR('"+context.PARAMETER_DATE+"','YYYY-MM-DD')"