[英]"Unhandled expression type" in SQL subquery
I am using XrmToolBox with SQL 4 CDS to make some edits to a user in MS Dynamics.我正在使用带有 SQL 4 CDS 的 XrmToolBox 对 MS Dynamics 中的用户进行一些编辑。 I don't quite know where the error lies-- in the SQL expression?
我不太清楚错误出在哪里——在 SQL 表达式中? In the FetchXML that it gets converted to?
在它转换成的 FetchXML 中? Anyway, here's my expression:
无论如何,这是我的表达方式:
INSERT INTO systemuser (
firstname,
lastname,
internalemailaddress,
departmentid,
internalspecialtyid)
VALUES (
'John',
'Smith',
'john.smith@example.com',
(SELECT TOP 1 departmentid FROM department WHERE name = 'Commercial'),
(SELECT TOP 1 internalspecialtyid FROM internal_specialties WHERE name = 'B2B Comms'));
When I run this, I get this message from XrmToolBox:当我运行它时,我从 XrmToolBox 收到这条消息:
Unhandled expression type: (SELECT TOP 1 departmentid FROM department WHERE name = 'Commercial')
I really don't understand this.我真的不明白这一点。 I can select the subquery and execute it to get one response back.
我可以 select 子查询并执行它以获得一个响应。 I can take its results and make it a static (non-subquery) expression with no problem.
我可以把它的结果变成 static(非子查询)表达式,没有问题。 But why isn't this working?
但为什么这不起作用? I'm pretty new to SQL, assuming that's where the problem is, so I could easily misunderstand the subquery syntax.
我是 SQL 的新手,假设这就是问题所在,所以我很容易误解子查询语法。
The SQL 4 CDS tool attempts to provide as much a SQL implementation for CDS/Dataverse as possible but it's not perfect. SQL 4 CDS 工具试图为 CDS/Dataverse 提供尽可能多的 SQL 实现,但它并不完美。 Reach out to the tool author directly by opening an issue on the the SQL 4 CDS's GitHub page: https://github.com/MarkMpn/Sql4Cds/issues
通过在 SQL 4 CDS 的 GitHub 页面上打开问题直接联系工具作者: https://github.com/MarkMpn/Sql4Cds/issues
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.