One Star

TmysqlRow select based on inputs

Hi
I have a delimited file containing an email address and an id.
I want to run the following
select user_id form users where email like '%inputrow.email%' and id != inputrow.id
I enter this statement into a tmysqlrow I expect to be able to set the inputs to this component as
email and id and the outputs as user_id but the component requires the inputs and outputs to be identical.
Can the tmysqlRow select based on input values rather than hard coded values?
I tried to do this using a prepared Statement in the tmysqlrow but the %% caused a problem.
Thanks
1 REPLY
Community Manager

Re: TmysqlRow select based on inputs

Hi
We usually use tMysqlInput to execute a select query, you have to use a tParseRecordSet after tMysqlRow to parse the record set if you use tMysqlRow to execute a select query. For your problem, you can write a query like
"select user_id form users where email like '%" row1.email "%' and id !=" row1.id
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business