03.09.2015, 16:52 | #1 |
Участник
|
Несколько источников для QueryBuildDataSource
Доброго времени суток!
Пытаюсь повторить SQL запрос в коде: PHP код:
X++: Query q; QueryRun queryRun; QueryBuildDataSource qbDCN; QueryBuildDataSource qbDHL; QueryBuildDataSource qbDCC; QueryBuildDataSource qbDA; DimensionAttribute da; q = new Query(); qbDCN = q.addDataSource(tablenum(DimensionConstraintNode)); qbDCN.relations(false); qbDHL = qbDCN.addDataSource(tablenum(DimensionHierarchyLevel)); qbDHL.relations(false); qbDHL.addLink(fieldNum(DimensionConstraintNode,DimensionHierarchyLevel),fieldNum(DimensionHierarchyLevel,RecId)); qbDHL.joinMode(JoinMode::InnerJoin); qbDCC = qbDCN.addDataSource(tablenum(DimensionConstraintNodeCriteria)); qbDCC.relations(false); qbDCC.addLink(fieldNum(DimensionConstraintNode,RecId),fieldNum(DimensionConstraintNodeCriteria,DimensionConstraintNode)); qbDCC.joinMode(JoinMode::InnerJoin); qbDA = qbDHL.addDataSource(tablenum(DimensionAttribute)); qbDA.relations(false); qbDA.addLink(fieldNum(DimensionHierarchyLevel,DimensionAttribute),fieldnum(DimensionAttribute,RecId)); qbDA.joinMode(JoinMode::InnerJoin); |
|