QueryRun qr = new QueryRun(yourQuery); ; while (qr.next()) { iSum = qr.get(tableNum(InventSum)); info(iSum.itemId); }