tb1810
19th February 2004, 16:09
hallo zusamman,
seit ändern unseres portingsets auf port6.1c.06.01 funktionieren einige unserer dynamischen sql-statements nicht mehr. fehlermeldung:"degree mismatch in reference predicate(tdinv001)
query not correct on select...can not continue.... in folgendem sql-statement


function build.queries()
{

sql$ = "SELECT toitm100.*,"
& "tiitm001.item,tiitm001.dsca,tiitm001.dscb,tiitm001.dscc,tiitm001.dscd,"
& "tiitm001.seak,tiitm001.seab,tiitm001.cups,"
& "tdinv001.stoc,tdinv001.reop,tdinv001.allo,tdinv001.blck,tdinv001.ordr, tdinv001.maxs,"
& "tiitm001.cuni, tiitm001.citg, tiitm001.kitm, tiitm001.csig, tiitm001.ctyp,"
& "tcmcs015.dsca "
& "FROM toitm100,tiitm001,tdinv001,tcmcs015 "
& "WHERE toitm100._index2 inrange {:1} and {:2} "

if (sknr >= 2) then
sql$ = sql$ & " and EXISTS ( select itm100.*"
& " from toitm100 itm100"
& " where itm100._index1 inrange {toitm100.item,:3}"
& " and {toitm100.item,:4}"
& " ) "
endif

if (sknr >= 3) then
sql$ = sql$ & " and EXISTS ( select itm100a.*"
& " from toitm100 itm100a"
& " where itm100a._index1 inrange {toitm100.item,:5}"
& " and {toitm100.item,:6}"
& " ) "
endif

if (sknr >= 4) then
sql$ = sql$ & " and EXISTS ( select itm100b.*"
& " from toitm100 itm100b"
& " where itm100b._index1 inrange {toitm100.item,:7}"
& " and {toitm100.item,:8}"
& " ) "
endif

sql$ = sql$ & "AND toitm100.item refers to tiitm001 "
sql$ = sql$ & "AND tiitm001.ctyp refers to tcmcs015 unref clear "

if isspace(ucwar) then
sql$ = sql$ & "and {:9, toitm100.item} refers to tdinv001 unref clear "
else
sql$ = sql$ & "and {:9,toitm100.item} refers to tdinv001 unref skip "
endif

sql$ = sql$ & "ORDER BY toitm100._index2 "

sql = sql.parse(sql$)

sql.where.bind(sql, 1, sk1)
sql.where.bind(sql, 2, sk1t)
sql.where.bind(sql, 3, sk2)
sql.where.bind(sql, 4, sk2t)
sql.where.bind(sql, 5, sk3)
sql.where.bind(sql, 6, sk3t)
sql.where.bind(sql, 7, sk4)
sql.where.bind(sql, 8, sk4t)
sql.where.bind(sql, 9, ucwar)

sql.exec(sql)
}

hat das auch jemand gehabt? wie müßten wir unsere scripte anpassen.

danke tb1810

rochus
19th February 2004, 17:52
When compiling a script that has a 'refers to' statement while using portingset 6.1c.05.02 or higher, where the number of fields before the 'refers to' (still) is different from the number of fields after the 'refers to' the compiler gives the error: "Degree mismatch in reference predicate".

A number of scripts which used the 'refers to' statement in a wrong way were changed in solution 156806 to prevent this error after the installation of portingset 6.1c.05.02 or higher.

If the error occurs when compiling a script the 'refers to' statement in the script, that gives the error, has to be changed, so the number of fields before and after the 'refers to' statement are the same. When the problem is found during the compilation of a standard script a defect should be created and placed in the queue that solves problems in that script, so the situation can be corrected.

refers to {2} felder auf {2} felder (bei refers to tdinv001)

tb1810
19th February 2004, 18:26
thank you
this was the solution