CURRENT DEBUG MODE

CURRENT DEBUG MODE specifies the default value for the DEBUG MODE option when certain routines are created. The DEBUG MODE option specifies whether the routine should be built with the ability to run in debugging mode.

Start of changeCURRENT DEBUG MODE specifies the default value for the DEBUG MODE option of the following statements:End of change

Start of change
  • ALTER FUNCTION for a new version of an SQL scalar function
  • ALTER PROCEDURE for a new version of a native SQL procedure
  • CREATE FUNCTION for an SQL scalar function
  • CREATE PROCEDURE for a Java procedure
  • CREATE PROCEDURE for a native SQL procedure
End of change

The data type is VARCHAR(8). The following values are valid:

  • ALLOW — Specifies that the routine can be run in debugging mode.
  • DISALLOW — Specifies that the routine cannot be run in debugging mode. A subsequent ALTER statement can change the DEBUG MODE option to allow the routine to run in debugging mode.
  • DISABLE — Specifies that the routine can never be run in debugging mode. When DISABLE is in effect, the routine cannot be changed to run in debugging mode. A subsequent ALTER statement cannot change the DEBUG MODE option to allow or disallow the routine to run in debugging mode.

The value of CURRENT DEBUG MODE in a user-defined function or stored procedure is inherited according to the rules in Table 1. In other contexts the initial value of CURRENT DEBUG MODE is DISALLOW.

You can change the value of the CURRENT DEBUG MODE special register by running the SET CURRENT DEBUG MODE statement.

Example: Set the host variable DEBUG_MODE_OPT to the value of the CURRENT DEBUG MODE special register:
  VALUES CURRENT DEBUG MODE INTO :DEBUG_MODE_OPT;