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

my context variable is null in the tMysqlInput query

Hello!

I have a problem with my job when I want to make a query with 2 context variables. I attached photos with my job and my components and when I run the job, it's giving me this error:

Exception in component tMysqlInput_1 (facebook_amazon_us)
java.lang.NullPointerException
at mava.facebook_amazon_us_0_1.facebook_amazon_us.tWaitForFile_1Process(facebook_amazon_us.java:2058)
at mava.facebook_amazon_us_0_1.facebook_amazon_us.tMysqlConnection_1Process(facebook_amazon_us.java:798)
at mava.facebook_amazon_us_0_1.facebook_amazon_us.runJobInTOS(facebook_amazon_us.java:5363)
at mava.facebook_amazon_us_0_1.facebook_amazon_us.main(facebook_amazon_us.java:5085)

What I want to do in this job: I have a csv file with multiple columns. The first one is called Reporting_Starts. I want to get the first registration from that column and put it in the query for a select like: SELECT * FROM my_table WHERE MONTH(my_table.Reporting_Starts)='"+context.month+"'. I cannot get why my tJava_4 sees the variables and tMysqlInput don't. 

In my tJava_4 I have the following code:

System.out.println(context.month);

 

Please let me know if you need any additional information about the job.

Thanks!

 

Labels (3)
1 Reply
Vishu1
Employee
Employee

I think this because of the link between the components. could you please try removing iterate link from tInputFileDelimited_1 and connect javarow1 to java4 with onComponentOK link.