20.08.2007, 15:37 | #1 |
Участник
|
Восемь датасоурсов на форме
Всем доброго дня !!
(Ax3.0 SP4 Sql2005 трехзвенка) На форме 8 (восемь) датасурсов, вот код на init формы: Код: Query query1,query2; QueryRun queryRun; QueryBuildDataSource qbds1,qbds2,qbds3,qbds4,qbds5,qbds6,qbds7,qbds8; QueryBuildRange qbr1,qbr2,qbr3,qbr4,qbr5,qbr6; ; query1 = PurchLineDesign_Q; qbds1 = query1.dataSourceTable(tablenum(PurchLine)); qbds2 = query1.dataSourceTable(tablenum(InventDim)); qbds3 = query1.dataSourceTable(tablenum(PurchClaimPurchLine)); qbds4 = query1.dataSourceTable(tablenum(PurchClaimTable)); qbds5 = query1.dataSourceTable(tablenum(SalesLine)); qbds6 = query1.dataSourceTable(tablenum(SalesTable)); qbds7 = query1.dataSourceTable(tablenum(InventReferenceTrans)); qbds8 = query1.dataSourceTable(tablenum(InventReference)); qbds1.clearLinks(); qbds2.clearLinks(); qbds3.clearLinks(); qbds4.clearLinks(); qbds5.clearLinks(); qbds6.clearLinks(); qbds2.addLink(fieldnum(PurchLine,InventDimId),fieldnum(InventDim,InventDimId)); qbds2.joinMode(JoinMode::InnerJoin); qbds2.fetchMode(0); qbds3.addLink(fieldnum(PurchLine,RecId),fieldnum(PurchClaimPurchLine,purchLineRecId)); qbds3.joinMode(JoinMode::InnerJoin); qbds3.fetchMode(0); qbds4.addLink(fieldnum(PurchClaimPurchLine,PurchClimeRecId),fieldnum(PurchClaimTable,RecId)); qbds4.joinMode(JoinMode::InnerJoin); qbds4.fetchMode(0); qbds5.addLink(fieldnum(PurchClaimTable,SalesRecId),fieldnum(salesLine,RecId)); qbds5.joinMode(JoinMode::InnerJoin); qbds5.fetchMode(0); qbds6.addLink(fieldnum(SalesLine,SalesId),fieldnum(SalesTable,SalesId)); qbds6.joinMode(JoinMode::InnerJoin); qbds6.fetchMode(0); qbds7.addLink(fieldnum(PurchLine,RecId),fieldnum(InventReferenceTrans,purchLineRecId)); qbds7.joinMode(JoinMode::InnerJoin); qbds7.fetchMode(0); qbds8.addLink(fieldnum(InventReferenceTrans,InventReferenceId),fieldnum(InventReference,InventReferenceId)); qbds8.joinMode(JoinMode::InnerJoin); qbds8.fetchMode(0); qbr2 = Global::findOrCreateRange_W(qbds2,fieldnum(InventDim,InventProjectId),'условие'); PurchLineDesign_DS.executeQuery(); Код: SELECT FIRSTFAST * FROM PurchLine JOIN FIRSTFAST * FROM PurchClaimPurchLine WHERE PurchLine.RecId = PurchClaimPurchLine.purchLineRecId JOIN FIRSTFAST * FROM PurchClaimTable WHERE PurchClaimPurchLine.purchClimeRecId = PurchClaimTable.RecId JOIN FIRSTFAST * FROM SalesLine WHERE PurchClaimTable.SalesRecId = SalesLine.RecId JOIN FIRSTFAST * FROM SalesTable WHERE SalesLine.SalesId = SalesTable.SalesId JOIN FIRSTFAST * FROM InventDim USING INDEX DimIdIdx WHERE PurchLine.InventDimId = InventDim.inventDimId OUTER JOIN FIRSTFAST * FROM inventReferenceTrans WHERE PurchLine.RecId = inventReferenceTrans.purchLineRecId JOIN FIRSTFAST * FROM inventReference WHERE inventReferenceTrans.inventReferenceId = inventReference.inventReferenceId Пробовал добавлять фиктивные ссылки по DataAreaId на все подчененные датасурсы - не помогает. В чем может быть причина ? Спасибо |
|
Теги |
ax3.0 |
|
|