I am new to Talend, but I want to have a job similar to this:
in a tMysqlInput, make a select statement that returns a single row with a single column and then use that value in a tMongoDBInput query to get multiple documents.
How can I do that in a single job, as I am unable to link tMysqlInput to tMongoDBInput with a row(Main)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can do this :
tMysqlInput -- main -- tFlowToIterate -- Iterate -- tMongoDBInput -- tMap -- etc
The input flow of tFlowToIterate gets converted to global variables, so you can use it in your mongoDB component query by referencing the global variable : (String)globalMap.get("rowX.MyColumn")
rowX is the name of tFlowToIterate's incoming main row, and MyColumn is the column name. Make sure to cast the variable to the appropriate java type.