为什么我不能在select语句中使用CTE? [英] Why can't I use a CTE in my select statement?

查看:284
本文介绍了为什么我不能在select语句中使用CTE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行数据库查询的Mule应用程序,该查询运行得很好(尽管有点慢).详细信息是:

I have a Mule application running a DB query which runs perfectly well (albeit a little bit slow). It's details are:

  • M子3.7.2 EE
  • Anypoint Studio 5.4.1
  • jdk1.7.0_51
  • 使用oracle ojdbc6驱动程序
  • Mule 3.7.2 EE
  • Anypoint Studio 5.4.1
  • jdk1.7.0_51
  • Using oracle ojdbc6 driver

现在,当我使用ojdbc6驱动程序创建database连接时,不使用公用表表达式(CTE)时,查询运行良好(2.5秒).

Now when I create a database connection using the ojdbc6 driver, without the use of a Common Table Expression (CTE) the query runs fine (at 2.5 secs).

当我使用CTE时,查询失败,并显示以下错误:

When I utilise my CTE, the query fails with the error:

org.mule.api.MessagingException:查询类型必须是"[SELECT,STORE_PROCEDURE_CALL]"之一,但必须是"DDL"(java.lang.IllegalArgumentException).邮件有效载荷的类型为:NullPayload

org.mule.api.MessagingException: Query type must be one of '[SELECT, STORE_PROCEDURE_CALL]' but was 'DDL' (java.lang.IllegalArgumentException). Message payload is of type: NullPayload

很明显,在某些时候,Mule EE服务器认为我正在尝试执行DDL.

Clearly at some point the Mule EE server thinks that I'm trying to execute DDL when I'm not.

使用CTE的新查询在SQL Developer中可以很好地正常工作(.250秒),所以我知道这不是我的查询.

The new query, using the CTE, works perfectly fine (at .250 sec) in SQL Developer, so I know that it's not my query.

为什么不能在Mule中使用CTE(WITH)语句?

Why can't I use the CTE (WITH) statement in Mule?

这是一个已知问题吗?我在做错什么吗?

Is this a known issue? Am I doing something wrong?


在CTE之前进行查询(简体):


Query (simplified) before CTE:

SELECT '1' AS COLUMN_ONE, 'X' AS COLUMN_X
FROM DUAL

在CTE之后查询(简体):

Query (simplified) after CTE:

WITH TBL AS
(
    SELECT '1' AS COLUMN_ONE, 'X' AS COLUMN_X
    FROM DUAL
)
SELECT * FROM TBL

推荐答案

Mule不支持 CTE语句.

我必须对此进行深入研究.

I had to dig deep for this one.

  • 我发布了此问题,并标记了@MuleSoft和@MuleDev
    • 我收到的回复:
    • I tweeted this question and tagged @MuleSoft and @MuleDev
      • To which I got the reply:

      如果您还没有的话,我们也建议您在论坛中发布- http://forums.mulesoft.com

      • 无济于事
      • 我收到的回复:
      • To which I got the reply:

      Mule ESB当前不支持WITH.提出了增强请求(SE-987),但尚未实施.
      工程团队根据优先级对JIRA进行工作.如果您急需JIRA,请提供以下信息,我们将为您升级JIRA

      WITH is not currently supported by Mule ESB. Enhancement request(SE-987) has been raised but not implemented yet.
      Engineering team work on JIRAs based on the priorities. If this JIRA is urgent to you, please provide the following information then I will escalate the JIRA for you

      这篇关于为什么我不能在select语句中使用CTE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆