I have defined one context parameter: search_id.
Now there is one component tMySqlInput in my job.
I need to search some data by below sql:
unfortunately using bind variables is only allowed in row components and not input components: https://jira.talendforge.org/browse/TDI-6749
You can still concatenate the context variable to the query string as you would do in Java, for example:
"SELECT count(1) FROM business WHERE business_id = " + context.search_id
I'm assuming search_id is a number so no need to surround it with single quotes. Otherwise it would be:
"SELECT count(1) FROM business WHERE business_id = '" + context.search_id + "'"
See this screenshot for an example:
Please accept and/or up-vote the answer if you think it's useful, thanks!