Six Stars

How to pass variable to tMysqlInput?

Hi Talend Community,

 

I have a job that needs to do the following:

extract data variable from table -> Iterate row-> select new data set based on variable input.

Here is my current job

dbjob.PNG

Here is my tMysqlInput_2 select:

"select  result from details where customerid ="+((String)globalMap.get("row1.customer"))

 

When I execute I get the following error

Exception in component tMysqlInput_2
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'AF214DS' in 'where clause'

It seems to be replacing the variable with the column name....

  • Big Data
  • Data Integration
  • ESB
1 ACCEPTED SOLUTION

Accepted Solutions
Eleven Stars TRF
Eleven Stars

Re: How to pass variable to tMysqlInput?

Change the expression to build the SQL query, because value must be enclosed between '' :

"select  result from details where customerid = '"+((String)globalMap.get("row1.customer"))+"'"

TRF
1 REPLY
Eleven Stars TRF
Eleven Stars

Re: How to pass variable to tMysqlInput?

Change the expression to build the SQL query, because value must be enclosed between '' :

"select  result from details where customerid = '"+((String)globalMap.get("row1.customer"))+"'"

TRF