You can use the TRACE statements to specify that the precompiler runtime environment logs the execution of individual embedded SQL statements in the trace file <filename>.pct at runtime of the application program.
Include the SQL statements that you want to log in the statements SET TRACE ON or SET TRACE LONG and SET TRACE OFF.
Any SQL statements that appear in external subroutines or modules called by the included SQL statements are also logged.
To activate logging for the whole application program, set your chosen trace option when you run the precompiler or call the program. The trace option then overrides the individual TRACE statements.
EXEC SQL SET TRACE ON; |
Activates logging with the trace option TRACE SHORT Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2]. |
Activates logging with the trace option TRACE LONG Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2] and all parameter values. |
|
EXEC SQL SET TRACE OFF; |
Deactivates logging |
EXEC SQL SET TRACE LINE <trace_line>; |
The content of <trace line> is written to the trace file as a comment. You can specify <trace line> as a character string or in a host variable. |