Azure 逻辑应用 Sql 连接器
Azure Logic App Sql Connector
我正在开发从 SQL 服务器数据库中提取 CDC 数据的逻辑应用程序。我正在使用 Get Rows 操作,但是当我尝试使用 Filter Query 参数时出现问题。
code eq '793'
(有效)
__$operation eq '2'
(不工作)
@{string('__$operation')} eq '2'
(不工作)
我认为问题可能出在“$”字符上。
错误信息
{
"status": 400,
"message": "Syntax error at position 12 in '__$operation eq '2'' "
}
谁能帮帮我!
I am using Get Rows operation but the problem comes in when I try to use the Filter Query parameter.
I think the problem might be with the "$" character.
根据我的测试,如果 field/column 包含 $
(或 __
)并在 Filter Query 中使用该字段,这工作正常。
但是如果我将字段定义为以__$
开头的__$operation
,当我在Filter Query中使用它时会导致同样的问题。 因此,如果可能,您可以尝试修改 SQL 数据库中的列名。
$
是根据OData Normative保留的字符,在URI形成之前应该对其进行百分号编码。不幸的是,我尝试了百分比编码,但仍然出现语法错误,似乎在过滤查询中是不允许的。
解决方案
这里是解决方法,在Logic App中你不能在Filter Query中使用%
,所以你不能对$
使用%24
,而应该使用[=14] =].我现在可以成功得到结果了:
注意开头有三个_
。如果 field/column 名称中有其他特殊字符,则可以使用此模式。比如字段名是Display Name
,中间有一个space字符,那么在Filter Query中,需要将其转换为Display_0x0020_Name
有关此编码的更多详细信息,请参阅Encode and Decode XML Element and Attribute Names and ID Values
我正在开发从 SQL 服务器数据库中提取 CDC 数据的逻辑应用程序。我正在使用 Get Rows 操作,但是当我尝试使用 Filter Query 参数时出现问题。
code eq '793'
(有效)__$operation eq '2'
(不工作)@{string('__$operation')} eq '2'
(不工作)
我认为问题可能出在“$”字符上。
错误信息
{
"status": 400,
"message": "Syntax error at position 12 in '__$operation eq '2'' "
}
谁能帮帮我!
I am using Get Rows operation but the problem comes in when I try to use the Filter Query parameter.
I think the problem might be with the "$" character.
根据我的测试,如果 field/column 包含 $
(或 __
)并在 Filter Query 中使用该字段,这工作正常。
但是如果我将字段定义为以__$
开头的__$operation
,当我在Filter Query中使用它时会导致同样的问题。 因此,如果可能,您可以尝试修改 SQL 数据库中的列名。
$
是根据OData Normative保留的字符,在URI形成之前应该对其进行百分号编码。不幸的是,我尝试了百分比编码,但仍然出现语法错误,似乎在过滤查询中是不允许的。
解决方案
这里是解决方法,在Logic App中你不能在Filter Query中使用%
,所以你不能对$
使用%24
,而应该使用[=14] =].我现在可以成功得到结果了:
注意开头有三个_
。如果 field/column 名称中有其他特殊字符,则可以使用此模式。比如字段名是Display Name
,中间有一个space字符,那么在Filter Query中,需要将其转换为Display_0x0020_Name
有关此编码的更多详细信息,请参阅Encode and Decode XML Element and Attribute Names and ID Values