Start of change

ROUTINE_TYPE

This global variable contains the type of the currently executing routine.

This global variable has the following characteristics:
  • It is read-only, with values maintained by system.
  • The type is CHAR(1).
  • The schema is SYSIBM.
  • The scope of this global variable is session.

The value of the global variable is 'P' for procedure or 'F' for function. If there is no routine currently executing, the value is NULL.

The value of ROUTINE_TYPE global variable is set only for procedures and functions. The value always reflects the type of the currently executing routine.

The value is not changed for functions that are inlined. The value remains the same as it was when the inline function was invoked.

End of change