19.01.2013, 10:50 | #1 |
Иван Захаров
|
AX 2009 Ошибка запроса с условием по полю Dimension[x]
Возможно здесь где-то уже пролетала такая ошибка ...
К сожалению, результат выполнения двух этих циклов разный. Первый выдает инфолог, второй - нет. Отличаются только указанием условия inventTable.Dimension[12]: X++: VendInvoiceTrans vendInvoiceTrans; InventTable inventTable; ; while select forceliterals vendinvoiceTrans group by TableId where vendinvoiceTrans.Voucher == "Ю3РПН00710274" join inventTable group by Dimension[12] where inventTable.ItemId == vendinvoiceTrans.ItemId && inventTable.Dimension[12] != '' { info("1 - OK"); } while select forceliterals vendinvoiceTrans group by TableId where vendinvoiceTrans.Voucher == "Ю3РПН00710274" join inventTable group by Dimension[12] where inventTable.ItemId == vendinvoiceTrans.ItemId && inventTable.Dimension[12] { info("2 - OK"); } В первом цикле - вполне корректный: SELECT B.DIMENSION12_ FROM VENDINVOICETRANS A,INVENTTABLE B WHERE ((A.DATAAREAID=N'y31i') AND (A.VOUCHER=N'Ю3РПН00710274')) AND ((B.DATAAREAID=N'y31i') AND ((B.ITEMID=A.ITEMID) AND (B.DIMENSION12_<>' '))) GROUP BY B.DIMENSION12_ ORDER BY B.DIMENSION12_ А во втором - WTF?! SELECT B.DIMENSION12_ FROM VENDINVOICETRANS A,INVENTTABLE B WHERE ((A.DATAAREAID=N'y31i') AND (A.VOUCHER=N'Ю3РПН00710274')) AND ((B.DATAAREAID=N'y31i') AND ((B.ITEMID=A.ITEMID) AND ((((((((((((((((((B.DIMENSION>' ') AND (B.DIMENSION2_>' ')) AND (B.DIMENSION3_>' ')) AND (B.DIMENSION4_>' ')) AND (B.DIMENSION5_>' ')) AND (B.DIMENSION6_>' ')) AND (B.DIMENSION7_>' ')) AND (B.DIMENSION8_>' ')) AND (B.DIMENSION9_>' ')) AND (B.DIMENSION10_>' ')) AND (B.DIMENSION11_>' ')) AND (B.DIMENSION12_>' ')) AND (B.DIMENSION13_>' ')) AND (B.DIMENSION14_>' ')) AND (B.DIMENSION15_>' ')) AND (B.DIMENSION16_>' ')) AND (B.DIMENSION17_>' ')) AND (B.DIMENSION18_>' ')))) GROUP BY B.DIMENSION12_ ORDER BY B.DIMENSION12_ |
|
|
За это сообщение автора поблагодарили: S.Kuskov (2). |
|
|