Code: Alles auswählen.
po_guids (Returning Parameter)
pi_guids (Importing Parameter)
SELECT DISTINCT a~guid_cdoc INTO TABLE po_guids FROM cdoc AS a
INNER JOIN rat AS b ON a~guid_cdoc = b~guid_cdoc
FOR ALL ENTRIES IN pi_guids
WHERE ( a~guid_cdoc = pi_guids-guid_cdoc
( SELECT DISTINCT d~giud_rat FROM rat AS d
INNER JOIN ord AS e ON d~guid_ord = e~guid_ord )
Select DISTINCT f~guid_ord FROM ord AS f
JOIN rep AS g ON f~guid_rep = g~guid_rep
JOIN order AS h ON f~guid_order = h~guid_order
WHERE g~name = 'Test_Name' ) )
Musst Du nicht unbedingt. Du kannst es auch "zu Fuß" machen, also Step-by-Step oder versuchen einen View im DDIC anzulegen.nordlender hat geschrieben: muss also einen Select mit mehrere Join's benutzen.
"....komme aber nicht weiter"...... weil????nordlender hat geschrieben: da brauche ich euren Rat. Habe angefangen dies zu schreiben, komme aber nicht weiter.
Da stecken also einige Syntaxfehler drin. Ein korrekter JOIN sieht vielmehr so aus:nordlender hat geschrieben:Code: Alles auswählen.
po_guids (Returning Parameter) pi_guids (Importing Parameter) SELECT DISTINCT a~guid_cdoc INTO TABLE po_guids FROM cdoc AS a INNER JOIN rat AS b ON a~guid_cdoc = b~guid_cdoc FOR ALL ENTRIES IN pi_guids WHERE ( a~guid_cdoc = pi_guids-guid_cdoc *** An dieser Stelle fehlt eine logische Verknüpfung zwischen dem *** WHERE und den nachfolgenden Statements ( SELECT DISTINCT d~giud_rat FROM rat AS d INNER JOIN ord AS e ON d~guid_ord = e~guid_ord ) *** Dieser SELECT hat gleich überhaupt keine WHERE Bedingung Select DISTINCT f~guid_ord FROM ord AS f JOIN rep AS g ON f~guid_rep = g~guid_rep JOIN order AS h ON f~guid_order = h~guid_order WHERE g~name = 'Test_Name' ) )
Code: Alles auswählen.
select cdoc~guid_cdoc into table po_guids
from cdoc
join rat on rat~guid_cdoc eq cdoc~guid_cdoc
join ord on ord~guid_ord eq rat~guid_ord
join rep on rep~guid_rep eq rep~guid_rep
join order on order~guid_order eq ord~guid_order
for all entries in pi_guids
where cdoc~guid_cdoc eq pi_guids~guid_cdoc
and rep~name = 'Test_Name'.
Code: Alles auswählen.
select guid_cdoc from cdoc into table po_guids
where guid_cdoc eq (
select guid_cdoc from rat
where guid_ord eq (
select guid_ord from ord
join rep on rep~guid_rep eq ord~guid_rep
join order on order~guid_order eq ord~guid_order
where rep~name = 'Test_Name' )).