Welcome to OStack Knowledge Sharing 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...