Try OpenEdge Now
skip to main content
DataServer for Microsoft SQL Server
Connecting the DataServer : Connecting a schema holder : Analyzing application execution with Enhanced Logger : Enabling ABL to SQL Correlation in Logging
 
Enabling ABL to SQL Correlation in Logging
The Enhanced Logger allows ABL to SQL correlation so that you can compare ABL database requests with SQL directives that are executed on the server.
In the DataServer log file, ABL to SQL correlation includes information from the client context, the ABL module and line number, along with the server context SQL that was generated based on the ABL code and run against the foreign data source. The correlation is enabled using the -Dsrv PRGRS_LOG_ABL,n switch where n ranges from 0 to 2, as demonstrated in the following example:
-Dsrv logentrytypes,SQL:2,PRGRS_LOG_ABL,2
For a DataServer broker instance, the SQL log entry type can be set by using the -Dsrv logentrytypes,SQL switch in the 'srvrStartupParam' property under the UBroker.MS section in OpenEdge Management/OpenEdge Explorer or ubroker.properties files or using the parameter file .pf.
The following table describes the PRGRS_LOG_ABL connect option values:
Table 46. PRGRS_LOG_ABL connect option values
Option Value
Description
0
Disables the ABL to SQL correlation feature. No correlation information will be logged.
1
Enables the ABL to SQL correlation feature for SQL-related log entry types. Every SQL request derived from the log entry type output is preceded by ABL filename and line number which can be correlated to a compiled listings file.
2
Enables a superset of value 1 which, along with correlation information, includes visual delimiters marking the start and end of each ABL file module.
Note: The SQL log entry type is specifically designed to output SQL-related logging information and therefore would be used most commonly in conjunction with the PRGRS_LOG_ABL -Dsrv switch. However, the PRGRS_LOG_ABL switch can be enabled to acquire module and line number information with any log entry type that writes SQL request information to the log.
The ABL to SQL correlation is logged in the dataserv.lg file where the log entries will contain the ABL module and the line number where the ABL procedure started. It will also contain information about the SQL query executed on the foreign data source and the visual delimiters.
The following ABL constructs log SQL query information:
*FIND statements
*FIND FIRST
*FIND NEXT
*FIND LAST
*FIND PREV
*FIND CURRENT
*FIND rid
*Dynamic FIND statements
*FIND-BY-ROWID
*FIND-CURRENT
*FIND-FIRST
*FIND-LAST
*FIND-UNIQUE
*FOR statements
*FOR EACH
*FOR FIRST
*FOR LAST
*QUERY statements
*OPEN
*GET-LAST
*GET-NEXT
*GET-PREV
*GET-FIRST
*REPOSITION-TO-ROWID
*REPOSITION-BACKWARD
*REPOSITION-FORWARD
*REPOSITION-TO-ROW
*QUERY-OPEN method
*CREATE statement
*UPDATE statement
*DELETE statement
*IMPORT statement
*EXPORT statement
*RUN STORED-PROCEDURE statement
*SQL Pass-thru statements
*RELEASE statement
*VALIDATE statement
*ASSIGN statement
*END statement
*CURRENT-VALUE statement
*NEXT-VALUE statement
*SET-VALUE statement
*DYNAMIC-CURRENT-VALUE statement
*DYNAMIC-NEXT-VALUE statement
*CAN-FIND function
*RECID function
*ROWID function
*ProDataSet FILL, SAVE-ROW-CHANGES, MERGE-CHANGES methods.
*DO Transaction
The following example shows how the ABL to SQL correlation is logged in the dataserv.lg file, when the FOR EACH statement is compiled.

Using PRGRS_LOG_ABL switch to log ABL to SQL correlation

FOR EACH Customer:
DISP NAME.
END.
The log output shown below, includes the ABL module name and the line number where the ABL procedure started in correlation to the SQL queries executed on the foreign data source. Visual delimiters are also logged for clarity in the log files.
[11/10/27@04:53:27.462-0400] P-007852 T-015312 1 MSS -- MSS version: Microsoft SQL Server 10.00.1600 (4203)
[11/10/27@04:53:27.712-0400] P-007852 T-015312 2 MSS SQL --------->{START} [abl2sql.p]
[11/10/27@04:53:27.712-0400] P-007852 T-015312 2 MSS SQL -------------------------------------------------------
[11/10/27@04:53:27.728-0400] P-007852 T-015312 2 MSS SQL ABL statement reference: abl2sql.p line 0 (15223)
[11/10/27@04:53:27.728-0400] P-007852 T-015312 2 MSS SQL SELECT * FROM "vp"."vp"."customer" WHERE 1 = 2
[11/10/27@04:53:27.728-0400] P-007852 T-015312 2 MSS SQL Execute on 0x1151348 Master Connection direct: SELECT * FROM "vp"."vp"."customer" WHERE 1 = 2 (15069)
[11/10/27@04:53:27.759-0400] P-007852 T-015312 2 MSS SQL ABL statement reference: abl2sql.p line 2 (15223)
[11/10/27@04:53:27.759-0400] P-007852 T-015312 2 MSS SQL SELECT "custnum", "country", "name", "address", "address2", "city", "state", "postalcode", "contact", "phone", "salesrep", "creditlimit", "balance", "terms", "discount", "comments", "fax", "emailaddress", PROGRESS_RECID, PROGRESS_RECID_IDENT_ FROM "vp"."vp"."customer" ORDER BY "custnum"
[11/10/27@04:53:27.759-0400] P-007852 T-015312 2 MSS SQL Execute on 0x11522a8 Firehose Connection Level 1 new: SELECT "custnum", "country", "name", "address", "address2", "city", "state", "postalcode", "contact", "phone", "salesrep", "creditlimit", "balance", "terms", "discount", "comments", "fax", "emailaddress", PROGRESS_RECID, PROGRESS_RECID_IDENT_ FROM "vp"."vp"."customer" ORDER BY "custnum" (15069)
[11/10/27@04:53:27.821-0400] P-007852 T-015312 2 MSS SQL <---------{END} [abl2sql.p]
For more information about the PRGRS_LOG_ABL switch, see OpenEdge Development: Debugging and Troubleshooting.