Try OpenEdge Now
skip to main content
Debugging and Troubleshooting
Troubleshooting Resources : Log Entry Types Detail : Query information logging : Starting query information logging : Starting query information logging on individual queries
 
Starting query information logging on individual queries
You can turn on query information logging programmatically for an individual query by doing the following:
*Ensure that the logging level of the QryInfo log entry type is Basic (level 2).
*Set the BASIC-LOGGING attribute of the query object handle to TRUE before the query starts, as follows:
*For a dynamically opened query, this is before the QUERY-PREPARE() method
*For a statically opened query, this is before the OPEN QUERY statement
Note: Since FOR EACH and static PRESELECT queries do not have an associated handle, you cannot log them at level 2.
If the query has already started, no query information logging occurs.
Upon successful startup, OpenEdge writes a message to the log file noting that it has turned on query information logging for the query; the message includes a Query ID, handle, and query name.
To turn off query information logging for the query, set the BASIC-LOGGING attribute of the query object handle to FALSE. If you do this before the query completes, no query statistics are written. OpenEdge writes a message to the log file noting that it has turned off query information logging for the query; the message includes a Query ID, handle, and query name.