X++:
ds = q.addDataSource(tableNum(PurchTable_request));
ds3 = ds.addDataSource(tableNum(RcontractTable));
ds3.addLink(fieldNum(PurchTable_request, RequestId), fieldNum(RcontractTable, RequestId));
ds3.joinMode(JoinMode::NoExistsJoin);
ds3.fetchMode(QueryFetchMode::One2One);
ds2 = ds.addDataSource(tableNum(PurchTable));
ds2.addLink(fieldNum(PurchTable_request, RequestId), fieldNum(PurchTable, RequestId));
ds2.joinMode(JoinMode::NoExistsJoin);
ds2.fetchMode(QueryFetchMode::One2One);
ds4 = ds.addDataSource(tableNum(PurchLine));
ds4.addLink(fieldNum(PurchTable_request, RequestId), fieldNum(PurchLine, RequestId));
ds4.joinMode(JoinMode::NoExistsJoin);
ds4.fetchMode(QueryFetchMode::One2One);
ds5 = ds.addDataSource(tableNum(AdvanceHolderTable));
ds5.addLink(fieldNum(PurchTable_request, RequestId), fieldNum(AdvanceHolderTable, RequestId));
ds5.joinMode(JoinMode::NoExistsJoin);
ds5.fetchMode(QueryFetchMode::One2One);
PurchTable_request_DS.query(q);
super();