Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 3 Monaten
Letzter Beitrag:
vor 2 Monaten, 3 Wochen
Beteiligte Autoren:
Stefan Bentvelsen, J. Flietstra

[WD22] Warning in query

Startbeitrag von Stefan Bentvelsen am 22.05.2017 08:54

Hi,

for test I have converted a WD19-project to WD22 and now there's a funny warning in a query that I do not understand ( Warning : The item of the join condition does not affect the joined tables. QRY_Select_EdkKoppels_voorPlanningVB, SQL Code, line 29, column 96)
but inWD19 this query has no warning and runs fine:


SELECT
TblEdkKoppel.TblEdkKoppelID AS TblEdkKoppelID,
TblEdkKoppel.Aantaldieren AS Aantaldieren,
TblEdkKoppel.aantalGeleverd AS aantalGeleverd,
TblEdkKoppel.Opzetdatum AS Opzetdatum,
TblEdkKoppel.tblHokID AS tblHokID,
TblEdkKoppel.tblRasID AS tblRasID,
TblEdkKoppel.tblRelatieID_Voerleverancier AS tblRelatieID_Voerleverancier,
TblEdkKoppel.TblrelatieID_vleeskuikenhouder AS TblrelatieID_vleeskuikenhouder,
TblEdkKoppel.TblRelatieID_afnemer AS TblRelatieID_afnemer,
TblHok.tblHokCode AS tblHokCode,
TblRas.Rascode AS Rascode,
TblRelatie.Bedrijfsnaam AS Vleeskuikenhouder,
TblRelatieIntegratie.Bedrijfsnaam AS Integratie,
TblRelatieVoerlev.Bedrijfsnaam AS Voerleverancier,
TblEdkKoppel.voorbroed AS voorbroed,
TblEdkKoppel.Hatchcare AS Hatchcare,
TblEdkKoppel.plus4 AS plus4,
TblEdkKoppel.TblArtikelID_enting AS TblArtikelID_enting,
TblEdkKoppel.leverdatum AS leverdatum,
TblEdkInleg.CodeFlockCD AS CodeFlockCD,
CASE WHEN TblEdkInleg.CodeFlockCD IS NULL THEN 1 ELSE 0 END AS NietGepland,
FileFlock.dateFlockStartDateBirth AS dateFlockStartDateBirth
FROM
TblEdkKoppel LEFT OUTER JOIN TblHok ON TblHok.tblHokID = TblEdkKoppel.tblHokID
LEFT OUTER JOIN TblRas ON TblRas.tblRasID = TblEdkKoppel.tblRasID
LEFT OUTER JOIN TblRelatie ON TblRelatie.TblRelatieID = TblEdkKoppel.TblrelatieID_vleeskuikenhouder
LEFT OUTER JOIN TblRelatie AS TblRelatieIntegratie ON TblRelatieIntegratie.TblRelatieID = TblEdkKoppel.TblRelatieID_afnemer
LEFT OUTER JOIN TblRelatie AS TblRelatieVoerlev ON TblRelatieVoerlev.TblRelatieID = FileFlock.KeyRelationID_Voerleverancier //

Antworten:

You have to JOIN first the FileFlock before use it!



LEFT OUTER JOIN TblRelatie AS TblRelatieVoerlev ON TblRelatieVoerlev.TblRelatieID = FileFlock.KeyRelationID_Voerleverancier //

von J. Flietstra - am 30.05.2017 09:31
Hi Jonathan,


FROM
TblEdkKoppel LEFT OUTER JOIN TblHok ON TblHok.tblHokID = TblEdkKoppel.tblHokID
LEFT OUTER JOIN TblRas ON TblRas.tblRasID = TblEdkKoppel.tblRasID
LEFT OUTER JOIN TblRelatie ON TblRelatie.TblRelatieID = TblEdkKoppel.TblrelatieID_vleeskuikenhouder
LEFT OUTER JOIN TblRelatie AS TblRelatieIntegratie ON TblRelatieIntegratie.TblRelatieID = TblEdkKoppel.TblRelatieID_afnemer
LEFT OUTER JOIN FileFlock ON TblEdkInleg.CodeFlockCD = FileFlock.CodeFlockCD
LEFT OUTER JOIN TblRelatie AS TblRelatieVoerlev ON TblRelatieVoerlev.TblRelatieID = FileFlock.KeyRelationID_Voerleverancier
LEFT OUTER JOIN TblEdkInleg ON TblEdkKoppel.TblEdkKoppelID = TblEdkInleg.TblEdkKoppelID


I've tried that, but than I get the same error on "CodeFlockCD" of TblEdkInleg.CodeFlockCD in the join with FileFlock?!?
Do have another suggestion, may be?

Thanks for your effort.

von Stefan Bentvelsen - am 30.05.2017 10:46

Re: [WD22] Warning in query (SOLVED)

Hi Jonathan,

I've found what the problem was. All joins where without commas which means that they where seemingly joined with TblEdkKoppel, but FileFlock is joined with TblEdkInleg, so I have added the table TblEdkInleg before the LEFT OUTER JOIN (with a comma after the previous join) and the same kind of problem was in the join between FileFlock and TblRelatieVoerlev. WD19 never had a problem with that, WD22 does.
Thanks again for your help.


FROM
TblEdkKoppel LEFT OUTER JOIN TblHok ON TblHok.tblHokID = TblEdkKoppel.tblHokID
LEFT OUTER JOIN TblRas ON TblRas.tblRasID = TblEdkKoppel.tblRasID
LEFT OUTER JOIN TblRelatie ON TblRelatie.TblRelatieID = TblEdkKoppel.TblrelatieID_vleeskuikenhouder
LEFT OUTER JOIN TblRelatie AS TblRelatieIntegratie ON TblRelatieIntegratie.TblRelatieID = TblEdkKoppel.TblRelatieID_afnemer
LEFT OUTER JOIN TblEdkInleg ON TblEdkKoppel.TblEdkKoppelID = TblEdkInleg.TblEdkKoppelID,
TblEdkInleg LEFT OUTER JOIN FileFlock ON TblEdkInleg.CodeFlockCD = FileFlock.CodeFlockCD,
FileFlock LEFT OUTER JOIN TblRelatie AS TblRelatieVoerlev ON TblRelatieVoerlev.TblRelatieID = FileFlock.KeyRelationID_Voerleverancier


von Stefan Bentvelsen - am 30.05.2017 11:10
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.