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

[resolved] Setting of Context Variable/Parameter

Hi
I have created a Context File with the following values.
host;localhost
port;9989
database;xyz
uname;root
pass;abc
dbid;1
start_date;2012-03-01 00:00:00
end_date;2012-03-27 00:00:00
Now i wanted to make use one of these variables(start_date) in a select Query.
My Query is
"select orders_id,date_purchased from xyz.orders
where date_purchased >" +context.start_date --> Is this the right way to specify the context variable?
My current flow is
tfileList -> tFileInputDelimited -> tContextLoad -> tMysqlInput -> tLogRow
I have set context.root under Directory in tFileList.
Once i run the job my current log shows as follows.
connecting to socket on port 3508
connected
tContextLoad_1 set key "host" with value "localhost"
tContextLoad_1 set key "port" with value "9989"
tContextLoad_1 set key "database" with value "xyz"
tContextLoad_1 set key "uname" with value "root"
tContextLoad_1 set key "pass" with value "abc"
tContextLoad_1 set key "dbid" with value "1"
tContextLoad_1 set key "start_date" with value "2012-03-01 00:00:00"
tContextLoad_1 set key "end_date" with value "2012-03-27 00:00:00"
Info: Parameter "root" has not been set by tContextLoad_1 --->Something is wrong here.Why it is not setting?
Exception in thread "main" java.lang.Error: java.lang.Error: Unresolved compilation problem:
start_date cannot be resolved or is not a field
at ereader_bi_etl.parameter_check_job_0_1.Parameter_check_job.tFileList_1Process(Parameter_check_job.java:841)
at ereader_bi_etl.parameter_check_job_0_1.Parameter_check_job.runJobInTOS(Parameter_check_job.java:1407)
at ereader_bi_etl.parameter_check_job_0_1.Parameter_check_job.main(Parameter_check_job.java:1271)
Caused by: java.lang.Error: Unresolved compilation problem:
start_date cannot be resolved or is not a field
disconnected
at ereader_bi_etl.parameter_check_job_0_1.Parameter_check_job.tMysqlInput_2Process(Parameter_check_job.java:1057)
at ereader_bi_etl.parameter_check_job_0_1.Parameter_check_job.tFileList_1Process(Parameter_check_job.java:804)
... 2 more
Job Parameter_check_job ended at 18:25 26/04/2012.
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
The reason you get this error is because you forgot to add context variables.
Regards,
Pedro

View solution in original post

3 Replies
Anonymous
Not applicable
Author

can someone please share some insight on this.
Anonymous
Not applicable
Author

Hi
The reason you get this error is because you forgot to add context variables.
Regards,
Pedro
Anonymous
Not applicable
Author

Thank you Pedro..I missed that..I worked now..