public void executeQuery() { Query queryLine; QueryBuildDataSource queryBuildDataSourceLine; QueryBuildRange qbrPurchId; ; purchLine_ds.autoQuery(false); queryLine = new Query(); QueryBuildDataSourceLine = queryLine.addDataSource(tableNum(PurchLine)); qbrPurchId = QueryBuildDataSourceLine.addRange(fieldnum(PurchLine, PurchId)); purchLine_ds.query(queryLine); qbrPurchId.value(strfmt('%1,%2', sysQuery::value("5"), sysQuery::value("6"))); super(); }If we open the form, the super()-Call of the executeQuery-methode needs approximately 100 seconds.
qbrPurchId.value(strfmt('%1', sysQuery::value("5")));then it needs only like one second.
static void BnQueryTest(Args _args) { PurchLine purchLine; Query query = new Query(); QueryBuildDataSource qbds; queryrun queryRun; ; qbds = query.addDataSource(tablenum(PurchLine)); qbds.addRange(fieldnum(purchLine, purchId)).value(strfmt("%1,%2", sysQuery::value("6"), sysQuery::value("7"))); queryRun = new queryrun(query); while(queryrun.next()) { purchline = queryrun.get(tablenum(purchline)); info(purchLine.PurchId); } }The oracle-statistik shows that the form-query causes the readin of approximatly 80 000 logical blocks, the job-query 1 000 logical blocks.