Try OpenEdge Now
skip to main content
DataServer for Oracle
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,PRGRS_LOG_ABL2
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 Explorer or ubroker.properties files or using the parameter file .pf.
The following table describes the PRGRS_LOG_ABL connect option values:
Table 54. 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 is 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 statement
*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
Using PRGRS_LOG_ABL switch to log ABL to SQL correlation
This example shows how the ABL to SQL correlation is logged in the dataserv.lg file, when the FOR EACH statement is compiled.
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/04@02:15:46.582+2300] P-007956 T-006300 2 ORA SQL
--------->{START} [C:\OpenEdge\WRK\p18695_DSexample.ped]
[11/10/04@02:15:46.582+2300] P-007956 T-006300 2 ORA SQL ABL statement
reference: C:\OpenEdge\WRK\p18695_DSexample.ped line 0
[11/10/04@02:15:46.582+2300] P-007956 T-006300 2 ORA SQL SELECT
/*+ INDEX(T0 CUSTOMER##PROGRESS_RECID) */ * FROM HARI.CUST
[11/10/04@02:15:46.582+2300] P-007956 T-006300 2 ORA SQL ABL statement
reference: C:\OpenEdge\WRK\p18695_DSexample.ped line 0
[11/10/04@02:15:46.582+2300] P-007956 T-006300 2 ORA SQL OMER
T0 WHERE PROGRESS_RECID = :rid
[11/10/04@02:15:46.582+2300] P-007956 T-006300 2 ORA SQL the SQL
statement SELECT /*+ INDEX(T0 CUSTOMER##PROGRESS_RECID) */ * FROM
HARI.CUSTOMER T0 WHERE PROGRESS_RECID = :rid
[11/10/04@02:15:46.584+2300] P-007956 T-006300 2 ORA SQL ABL statement
reference: C:\OpenEdge\WRK\p18695_DSexample.ped line 1
[11/10/04@02:15:46.584+2300] P-007956 T-006300 2 ORA SQL SELECT
/*+ INDEX_ASC(T0 CUSTOMER##COUNTRYPOST) */ PROGRESS_RECID
For more information about the PRGRS_LOG_ABL switch, see OpenEdge Development: Debugging and Troubleshooting.