Entering content frame

 Trace Options 

Use

You can use the trace options to specify that the precompiler runtime environment logs the execution of the entire application program in the trace file <filename>.pct at runtime.

If you want to log individual embedded SQL statements only, then use the TRACE statements.

You can use the IRTRACE tool to activate and deactivate the trace at runtime.

Procedure

·        Specify your chosen default for the trace option in the precompiler options when you run the precompiler.

·        Set your chosen trace option for runtime in the environment variable SQLOPT.

The following table shows the possible trace options that you can specify when running the precompiler and calling the application program.

-T

Logs with the option TRACE SHORT

Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2].

-X

Logs with the option TRACE LONG

Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2] and all parameter values.

-F <trace_file_name>

Allows you to choose a name other than <filename>.pct for the trace file

If you do not specify any other trace options, then the option TRACE SHORT is activated at the same time.

If you specify pid or PID for <trace_file_name>, then the name of the trace file becomes pid<process_id>.pct automatically. In this way, you can generate multiple trace files in parallel. If you do not specify any other trace options, then logging is deactivated at the same time.

 

The following table shows the possible trace options that you can specify only when you call the application program:

-N

Suppresses the logging of the date and time for the start and end of each executed SQL statement

-L <execution_time>

Specifies that any SQL statements that take longer to execute than <execution_time> are logged

Specify <execution_time> in seconds.

The log option TRACE LONG is used automatically. Dates and times cannot be suppressed with –N.

-Y <statement_count>

Specifies that logging alternates between the two trace files < filename>.pct and < filename>.prot in the run directory of the application program.

Use <statement_count> to specify how many SQL statements are logged in each file. If the number of SQL statements exceeds <statement_count> then the trace files are overwritten cyclically.

If you specify this option, then the option TRACE LONG is used automatically. Dates and times cannot be suppressed with –N.

See also Example of a Trace File

 

 

Leaving content frame