SQL Developer“与连接图的其余部分断开连接”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20242329/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 23:16:32  来源:igfitidea点击:

SQL Developer "disconnected from the rest of the join graph"

sqldb2oracle-sqldeveloper

提问by ESP

I have the following SQL:

我有以下 SQL:

select <misc things>
from pluspbillline 
left outer join workorder 
    on workorder.siteid=pluspbillline.siteid 
    and workorder.wonum = pluspbillline.refwo
    and workorder.orgid = pluspbillline.orgid
left outer join ticket
    on ticket.ticketid = pluspbillline.ticketid
    and ticket.class=pluspbillline.ticketclass
left outer join pluspsalesorder
    on pluspsalesorder.salesordernum=pluspbillline.salesordernum
    and pluspsalesorder.siteid=pluspbillline.siteid

In Oracle SQL Developer 4.0.0.13 (connected to a DB2 database), I get a squiggly line underneath the following italics: "from pluspbillline" and "left outer join workorder".

在 Oracle SQL Developer 4.0.0.13(连接到 DB2 数据库)中,我在以下斜体下方看到一条波浪线:“from pluspbillline”和“left externaljoin workorder”。

The warning says "pluspbillline is disconnected from the rest of the join graph". What does this mean?

警告说“pluspbillline 与连接图的其余部分断开连接”。这是什么意思?

采纳答案by WarrenT

I'm not sure what's causing Oracle SQL Developer to give the error. But I'm putting this comment here to format it properly.

我不确定是什么导致 Oracle SQL Developer 给出错误。但我把这条评论放在这里是为了正确格式化。

A join graph might look something like this

连接图可能看起来像这样

pluspbillline  ------+----<  workorder
                     |
                     +----<  ticket
                     |
                     +----<  pluspsalesorder

The lines on the graph might be labeled with the join fields. But this gives you a basic idea.

图形上的线条可能标有连接字段。但这给了你一个基本的想法。

I don't see any reason why you are getting this warning. A column name typo in your SQL perhaps? Or some quirk in Oracle's interface that it doesn't understand the DB2 metadata properly? I suggested trying IBM's tool to see if it's merely their program.

我看不出您收到此警告的任何原因。您的 SQL 中的列名拼写错误?或者 Oracle 界面中的某些怪癖无法正确理解 DB2 元数据?我建议尝试 IBM 的工具,看看它是否只是他们的程序。

回答by Ewanw

I got this as well. I'm not exactly sure how to articulate it but the error seems to be based on the logical flow of the code.

我也得到了这个。我不确定如何表达它,但错误似乎是基于代码的逻辑流程。

Essentially because you mention the table pluspbilllinebefore workorderI think it expects the join to be on pluspbillline.siteid=workorder.siteidetc.

基本上是因为您pluspbilllineworkorder我认为它希望连接on pluspbillline.siteid=workorder.siteid等之前提到了该表。

It seems that the order of the conditions for joins should flow from the first identified tables to the latest ones. So the following should make it happy:

连接条件的顺序似乎应该从第一个标识的表流向最新的表。所以以下应该让它高兴:

plusbillline to workorder       on pluspbillline.siteid=workorder.siteid...
    ""       to ticket          on pluspbillline.ticketid = ticket.ticketid...
    ""       to pluspsalesorder on pluspbillline.salesordernum = pluspsalesorder.salesordernum...

I don't believe this would change the work oracle does (assuming you don't use optimizer hints) so I'd only bother to change if you hate the squiggly lines.

我不相信这会改变 oracle 所做的工作(假设你不使用优化器提示)所以如果你讨厌波浪线,我只会费心去改变。

回答by Mark

The issue is caused by the Oracle Procedure having the same named input parameter as the column on the table you are joining to.
i.e input parm named bank_nbr and a table BankDept.bank_nbr will cause the error if you have WHERE bank_nbr = BankDept.bank_nbr I solved the issue by renaming the input parameter to in_bank_nbr and updating my where to read WHERE in_bank_nbr = BankDept.bank_nbr

该问题是由 Oracle 过程与您要加入的表中的列具有相同命名输入参数引起的。
即输入参数名为 bank_nbr 和表 BankDept.bank_nbr 将导致错误,如果你有 WHERE bank_nbr = BankDept.bank_nbr 我通过将输入参数重命名为 in_bank_nbr 并更新我的读取位置解决了这个问题 WHERE in_bank_nbr = BankDept.bank_nbr

回答by Gangnus

I had the same message when hovering over the "LEFT" word, but the whole query ran without a problem. On the other hand, when I hovered over "WITH", I got a piece of advice about restructuring the whole query. So, that message about disconnection could be not a sign of an error, but a warning about a too complex sentence. SQLDeveloper's editor does not mention the level of the problem.

将鼠标悬停在“LEFT”字上时,我收到了相同的消息,但整个查询运行没有问题。另一方面,当我将鼠标悬停在“WITH”上时,我得到了一条关于重组整个查询的建议。因此,关于断开连接的消息可能不是错误的迹象,而是对过于复杂的句子的警告。SQLDeveloper 的编辑器没有提到问题的级别。