【问题标题】:Azure Data Factory - Lookup ActivityAzure 数据工厂 - 查找活动
【发布时间】:2022-11-11 00:01:34
【问题描述】:

我正在使用 Azure 数据工厂中的查找活动调用一个过程。笔记:在这里使用 Lookup 的原因是,我想将过程中的 OUTPUT 参数值存储到 ADF 中的变量中以供将来使用。

下面的作品,

DECLARE @ADFOutputMsg [VARCHAR](500);
EXEC Test.spAsRunTVA @ReportDate = '2022-06-01', @OutputMsg = @ADFOutputMsg OUTPUT;
SELECT @ADFOutputMsg As OutputMsg;

但是当我想传递动态参数时,它不喜欢,

DECLARE @ADFOutputMsg [VARCHAR](500);
EXEC @{pipeline().parameters.SchemaName}.spAsRunTVA @ReportDate = @{substring(pipeline().parameters.FileName,8,10)}, @OutputMsg = ADFOutputMsg OUTPUT;
SELECT @ADFOutputMsg As OutputMsg;

我还尝试将日期保持原样,并将 SchemaName 更新为动态的,但我仍然收到错误消息。

【问题讨论】:

    标签: azure-data-factory


    【解决方案1】:

    请在您的动态内容中提供单引号' '

    '@{substring(pipeline().parameters.FileName,8,10)}'

    我试图在我的环境中重现类似的方法,结果如下:

    在查询中使用以下动态内容和查找活动。还添加了带单引号的动态内容' '

    select * from for_date where date1='@{string(pipeline().parameters.Date)}'
    

    添加Date范围

    得到这个输出:

    【讨论】:

      猜你喜欢
      • 2021-12-17
      • 2021-12-25
      • 1970-01-01
      • 1970-01-01
      • 2020-06-11
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多