TRACELEVEL

Produces a statistical analysis of application behavior by tracing certain operations in native applications. The report produced by this directive provides better readability and is inherently more useful than a traditional ODBC trace.

The statistical analysis information is written to a logfile named OpenESQLTrace.processID.log, which is created the first time you use TRACELEVEL. With each subsequent use of TRACELEVEL, tracing information is appended to the end of the file. A separator record is written at the end of each trace to help identify different traces.

OpenESQL creates the log files under the directory where the application is located. If file/directory permissions prevent file creation in that location, OpenESQL creates the log files under the directory referenced in the %TEMP% environment variable.

All trace records contain the elapsed run time, accurate to one microsecond.

Syntax:

TRACELEVEL={T | 1 | 2 | 3 | 4 |  | D}

Scope:

Used at compile time: No
Behavior at run time: Process

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Comments:

TRACELEVEL=T
When TRACELEVEL=T, the following information is written to the trace file:
  • BEGIN - traces main SQL directives
  • END - indicates end of run
  • DIRECTIVES - traces per compilation unit directives the first time a compilation unit is encountered at run time.
TRACELEVEL=1
When TRACELEVEL=1, the following information is written to the trace file in addition to the information written when you speficy TRACELEVEL=T:
  • PREPARE - identifies the original source code when a statement is prepared.
  • DISPOSE - provides summary information for overall statement usage when a statement is removed from the prepared statement cache at disconnect time
  • FLUSH - provides summary information for overall statement usage when a statement is flushed from the cache usually due to a cache overflow
TRACELEVEL=2
When TRACELEVEL=2, the following information is written to the trace file in addition to the information written when you specify TRACELEVEL=1:
  • OPEN
  • EXECUTE - provides the number of rows selected, inserted, or updated
  • EXEC_IMMED EXECUTE - provides the number of rows selected, inserted, or updated
  • ODBCCLOSE - provides summary information for the current cursor use
  • STMT_CHANGED - reports new concurrency and scroll option settings when the ODBC driver uses different settings than those requested by OpenESQL
TRACELEVEL=3
When TRACELEVEL=3, the following information is written to the trace file in addition to the information written when you specify TRACELEVEL=2:
  • ODBCFETCH - provides the number of rows fetched
  • COBOLFETCH - provides the number of rows returned to the COBOL application
TRACELEVEL=4
When TRACELEVEL=4, the following information is written to the trace file in addition to the information written when you specify TRACELEVEL=3:
  • EXEC_SQL_BEGIN
  • EXEC_SQL_END
TRACELEVEL=5
When TRACELEVEL=5, the following ODBC API call information is written to the trace file in addition to the information written when you specify TRACELEVEL=4:
  • ODBC_CALL_START
  • ODBC_CALL_END
TRACELEVEL=6
When TRACELEVEL= 6, only the following information is written to the trace file:
  • ODBC_CALL_START
  • ODBC_CALL_END
TRACELEVEL=D
When TRACELEVEL=D, a reduced version of TRACELEVEL=4 is produced for debugging purposes. It contains only the following information:
  • BEGIN
  • END
  • EXEC_SQL_BEGIN
  • EXEC_SQL_END
  • DIRECTIVES