CURRENT DEBUG MODE special register

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

CURRENT DEBUG MODE specifies the default value for the DEBUG MODE option of the following statements:

  • ALTER FUNCTION for a new version of an SQL scalar function
  • ALTER PROCEDURE for a new version of a native SQL procedure
  • ALTER TRIGGER (advanced) for a new version of a trigger
  • CREATE FUNCTION for an SQL scalar function
  • CREATE PROCEDURE for a Java™ procedure
  • CREATE PROCEDURE for a native SQL procedure
  • CREATE TRIGGER (advanced) for an advanced trigger

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

  • ALLOW — Specifies that the routine or trigger can be run in debugging mode.
  • DISALLOW — Specifies that the routine or trigger cannot be run in debugging mode. A subsequent ALTER statement can change the DEBUG MODE option to allow the routine or trigger to run in debugging mode.
  • DISABLE — Specifies that the routine or trigger can never be run in debugging mode. When DISABLE is in effect, the routine or trigger cannot be changed to run in debugging mode. A subsequent ALTER statement cannot change the DEBUG MODE option to allow or disallow the routine or trigger to run in debugging mode.
The value of CURRENT DEBUG MODE in a user-defined function, stored procedure, or trigger is determined 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

The following statement sets the host variable DEBUG_MODE_OPT to the value of the CURRENT DEBUG MODE special register.

  VALUES CURRENT DEBUG MODE INTO :DEBUG_MODE_OPT;