Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

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

I have the following 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".

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 pluspbillline before workorder I think it expects the join to be on pluspbillline.siteid=workorder.siteid etc.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...