【问题标题】:How to use the output of a query as input to another query如何使用查询的输出作为另一个查询的输入
【发布时间】:2018-01-05 15:55:07
【问题描述】:

我是 Talend 的新手,但我想从事与此类似的工作: 在 tMysqlInput 中,创建一个返回单行和单列的 select 语句,然后在 tMongoDBInput 查询中使用该值来获取多个文档。
我怎么能在一个工作中做到这一点,因为我无法将 tMysqlInput 链接到 tMongoDBInput 与行(主)?

【问题讨论】:

    标签: mysql mongodb talend


    【解决方案1】:

    你可以这样做:

    tMysqlInput -- main -- tFlowToIterate -- Iterate -- tMongoDBInput -- tMap -- etc
    

    tFlowToIterate 的输入流被转换为全局变量,因此您可以通过引用全局变量在 mongoDB 组件查询中使用它:(String)globalMap.get("rowX.MyColumn")

    rowX 是 tFlowToIterate 的传入主行的名称,MyColumn 是列名。确保将变量转换为适当的 java 类型。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-10
      • 2020-04-16
      • 1970-01-01
      • 2015-09-12
      • 2018-11-05
      相关资源
      最近更新 更多