Hi,
@Joris de Gruyter
info(query.xml()); - it works but query is not a "normal" query, it is to complex to analyze...
@Martin Dráb
Did you mean fetchMode(QueryFetchMode::One2One) to (B and C) and (B to D) ?
Summary I don't understand this query:-(
I try make my query in 2 variants:
Variant1:
A
|----B (1:n, innerJoin)
|------C (1:n, innerJoin)
|------D (1:n, innerJoin)
Variant2:
A
|----B (1:n, innerJoin)
|------C (1:1, innerJoin)
|------D (1:1, innerJoin)
Job is the same:
query = new query(querystr(AOTTestQuery));
queryRun = new QueryRun(query);
info (queryRun.query().dataSourceNo(1).toString());
while (queryRun.next())
{
A = queryRun.get(tableNum(A));
B = queryRun.get(tableNum(B));
C = queryRun.get(tableNum(C));
D = queryRun.get(tableNum(C));
info (strFmt("%1, %2 -> %3 i %4", A.RecId, B.RecId, C.RecId, D.RecId));
}
Results in Variant1:
ValueA, ValueB, 0, 0
ValueA, ValueB, ValueC1, 0
ValueA, ValueB, ValueC2, 0
ValueA, ValueB, ValueC3, 0
ValueA, ValueB, 0, ValueD1
ValueA, ValueB, 0, ValueD2
Results in Variant 2:
ValueA, ValueB, ValueC1, ValueD1
ValueA, ValueB, ValueC1, ValueD2
ValueA, ValueB, ValueC2, ValueD1
ValueA, ValueB, ValueC2, ValueD2
ValueA, ValueB, ValueC3, ValueD1
ValueA, ValueB, ValueC3, ValueD2
In Variant1:
I don’t understand results :-(
Info(queryRun.query().dataSourceNo(1).toString()); - invalid
In Variant2:
I have cartesian join.
Info(queryRun.query().dataSourceNo(1).toString()); - valid
Can anybody help me to understand my query in Variant1 ?