CURRENT DEBUG MODE special register

Start of changeCURRENT 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.End of change

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
  • Start of changeALTER TRIGGER (advanced) for a new version of a triggerEnd of change
  • CREATE FUNCTION for an SQL scalar function
  • CREATE PROCEDURE for a Java™ procedure
  • CREATE PROCEDURE for a native SQL procedure
  • Start of changeCREATE TRIGGER (advanced) for an advanced triggerEnd of change

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

Start of change
  • 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.
End of change
Start of changeThe 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.End of change

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;