How to use the output of a query as input to another query

我怕爱的太早我们不能终老 提交于 2019-12-24 08:48:18

问题


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.



来源:https://stackoverflow.com/questions/48117030/how-to-use-the-output-of-a-query-as-input-to-another-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!