my context variable is null in the tMysqlInput query

Four Stars

my context variable is null in the tMysqlInput query


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)
at mava.facebook_amazon_us_0_1.facebook_amazon_us.tWaitForFile_1Process(
at mava.facebook_amazon_us_0_1.facebook_amazon_us.tMysqlConnection_1Process(
at mava.facebook_amazon_us_0_1.facebook_amazon_us.runJobInTOS(
at mava.facebook_amazon_us_0_1.facebook_amazon_us.main(

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:



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



Six Stars

Re: my context variable is null in the tMysqlInput query

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.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach


Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.



Introduction to Talend Open Studio for Data Integration.