Copy Activity数据源查询解析错误:unexpected token: 'T15'排查求助
问题排查与解决
错误原因很明确:你拼接出来的查询语句里,日期值没有用单引号包裹。
变量LastModAccount的值是2024-02-14T15:02:57Z,原表达式拼接后生成的语句是:
Select Name, PersonEmail, RecordTypeId, PersonTitle from Account where LastModifiedDate>2024-02-14T15:02:57Z
Salesforce的查询引擎会把2024-02-14T15当成算术运算(2024减02减14T15),自然会抛出unexpected token: 'T15'的语法错误。
解决方法就是给日期变量加上单引号,修改后的管道表达式如下:
@concat('Select Name, PersonEmail, RecordTypeId, PersonTitle from Account where LastModifiedDate>\'',variables('LastModAccount'),'\'')
这样拼接后生成的正确查询语句是:
Select Name, PersonEmail, RecordTypeId, PersonTitle from Account where LastModifiedDate>'2024-02-14T15:02:57Z'
带单引号的日期字符串能被Salesforce正确识别为日期类型,语法错误就会消失。
内容的提问来源于stack exchange,提问作者Dhaval Mohandas
相关产品推荐
相关产品推荐

