The condition of the static query condition can be changed "on the fly" as follows:
DEFINE QUERY q-name FOR table-name. DEFINE VARIABLE h-qry AS HANDLE NO-UNDO. h-qry = QUERY q-name:HANDLE. h-qry:QUERY-PREPARE("for each table-name where table-name.field-name = 1").
from here, the request is processed in the same way as any regular static request.
readability: "buffer-handle: buffer-field (" field-name "): buffer-value" construct "refers to dynamic buffers - it is perfectly acceptable to use static buffers in dynamic queries (via name-name BUFFER: HANDLE), therefore dynamic buffers queries can be used with static buffers, and it is not always necessary to de-reference a field using its handle.
performance: the last time I did the comparison, dynamic queries were slower than static queries for the same query condition. Surface - they are more flexible than static queries.
reusability: after the dynamic request buffer structure has been configured, AFAIK cannot be changed. However, it can be reopened with a new filter condition, the same as with a static query.
source share