Позволю себе немного модифицировать макрос SqlIn. Идея таже, но реализация не через контейнер, а через масив. Плюс ещё добавлена проверка выхода за границы масива.
X++:
static void Job_SQL_IN(Args _args)
{
#LOCALMACRO.sqlIn
(
((%3 <= 1) && (%1 == %2[1])) ||
((%3 <= 2) && (%1 == %2[2])) ||
((%3 <= 3) && (%1 == %2[3])) ||
((%3 <= 4) && (%1 == %2[4])) ||
((%3 <= 5) && (%1 == %2[5])) ||
((%3 <= 6) && (%1 == %2[6])) ||
((%3 <= 7) && (%1 == %2[7])) ||
((%3 <= 8) && (%1 == %2[8])) ||
((%3 <= 9) && (%1 == %2[9])) ||
((%3 <= 10) && (%1 == %2[10]))
)
#ENDMACRO
custInvoiceTrans custInvoiceTrans;
InventDim InventDim;
inventLocationId inventLocationId;
container inventLocationCon;
int n;
inventLocationId inventLocationArr[10];
;
// inventLocationId = ...;
inventLocationCon = str2con_RU(inventLocationId, ',');
for (n = 1; n <= conlen(inventLocationCon); n++)
{
inventLocationArr[n] = conpeek(inventLocationCon, n);
}
n--;
while select custInvoiceTrans where custInvoiceTrans.InvoiceDate == 01\04\2010
join InventDim
where inventDim.inventDimId == CustInvoiceTrans.InventDimId &&
#sqlIn(inventDim.InventLocationId, inventLocationArr, n)
{
//...
}
}
P.S.: А вообще всё это извращения какие-то. Везде где это возможно лучше используйте Query.