在Azure Pipeline FetchXML查询中使用日期参数

bxpogfeg  于 2023-01-14  发布在  其他
关注(0)|答案(1)|浏览(158)

在我的Azure数据工厂管道中,我有一个参数,我们将其命名为“*pDate ”,它的默认值为 2023-01-01
但是每次运行管道(复制数据)时,我都希望能够更改它。
我可以使用如下所示的变量(
date 1 * variable)来实现这一点,但之后我必须更改变量的值。
我怎么能在这里插入一个参数呢?

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> 
<entity name="my_attachment"> 
<all-attributes/>  
<filter type="and"> 
<condition attribute="createdon" operator="on-or-after" value="@{variables('date1')}" /> 
</filter>  
</entity> 
</fetch>
cbjzeqam

cbjzeqam1#

  • 参数是特定管道中的常量,因此,您不能在管道中更改其值。
  • 具有静态值的变量(比如2023-01-01)本身就是一个参数。每次执行管道时,相同的值将被赋给变量,使其功能类似于参数。
  • 如果您的日期有一个模式,例如在10天或之前(从今天开始)创建,则可以为此值构建动态管道表达式。因此,每次运行管道时,该值都将根据需要动态变化。
  • 如果没有这样的模式,那么您必须使用参数。您仍然可以在每次运行管道时更改该值。
  • 当您尝试触发或调试管道时,pipeline run选项卡将提示您输入参数值。您只需给予所需值并相应地继续。
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="my_attachment">
<all-attributes/>
<filter type="and">
<condition attribute="createdon" operator="on-or-after" value="@{pipeline().parameters.req_date}" />
</filter>
</entity>
</fetch>

相关问题