M
Marko Myllymäki
Guest
For years, we have had the possibility to manage queries dynamically at runtime. In order to do that, we wrote code for retrieving the current structure of the query (used buffers, where clauses, by clauses etc.) by parsing the query string on-the-fly. Our parsing logic has been working just fine, but there are some query structures that are not supported. And I was wondering if there would nowadays be an easier way to handle this. Here is sample code to show what I was hoping to find: def var oQuery as Query. oQuery = new Query("for each customer no-lock where customer.name begins 'a', each order of customer no-lock"). display oQuery:NumBuffers // 2 oQuery:Buffer(2):Name // "order" oQuery:WhereExpression(1). // "customer.name begins 'a'" Note that we can't use query object for this because you have to know and set the buffers (hQuery:set-buffers) before using query-prepare. In our use case, we do not always know the buffers in advance so they must be parsed from the query string. Any ideas?
Continue reading...
Continue reading...