Generate query information
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
The following ABL constructs generate query information logging:
-
FOR[EACH|FIRST|LAST] statements:FOR EACH customer - Static
PRESELECTstatement onREPEATorDOblocks:REPEAT PRESELECT FOR EACH customer, EACH order OF CUSTOMER - Statically Opened Queries:
OPEN QUERY q FOR EACH customer -
Dynamically Opened Queries
It is possible to dynamically open both dynamic and static queries:
- For a dynamic query object:
DEFINE VARIABLE qh AS HANDLE NO-UNDO. CREATE QUERY qh. . . . qh:QUERY-PREPARE("FOR EACH customer"). qh:QUERY-OPEN(). - For a static query object:
DEFINE VARIABLE qh AS HANDLE NO-UNDO. DEFINE QUERY q FOR CUSTOMER. qh = q:HANDLE. qh:QUERY-PREPARE("FOR EACH customer"). qh:QUERY-OPEN().
- For a dynamic query object:
AGGREGATEstatement:AGGREGATE totalBalance = TOTAL(Balance) FOR Customer WHERE Country EQ 'USA' AND City EQ 'Boston'.
Query information logging logs information separately for each instance of the same query. For example, if a program containing a query calls itself recursively, information is logged for each instance of the query.