InventSum -> InventDim = InnerJoin
InventDim -> InventBatch = ExistsJoin
static void inventSumQuery(Args _args) { Query query; QueryRun queryRun; QueryBuildDataSource qbdsInventBatch, qbdsInventDim, qbdsInventSum; InventSum inventSum; query = new query(); //InventSum qbdsInventSum = query.addDataSource(tableNum(InventSum)); //joins InventDim qbdsInventDim = qbdsInventSum.addDataSource(tableNum(InventDim)); qbdsInventDim.relations(true); qbdsInventDim.joinMode(JoinMode::InnerJoin); //join InventBatch qbdsInventBatch = qbdsInventDim.addDataSource(tableNum(InventBatch)); qbdsInventBatch.relations(true); qbdsInventBatch.joinMode(JoinMode::ExistsJoin); //item range qbdsInventSum.addRange(fieldNum(InventSum, ItemId)).value("2664814"); queryrun = new QueryRun(query); while (queryRun.next()) { queryRun.changed(tableNum(InventSum)); { inventSum = queryRun.get(tableNum(InventSum)); info(strFmt("ItemId - %1",inventSum.itemid)); } } }
No comments:
Post a Comment