PACKAGE_NAME global variable

This built-in global variable contains the name of the currently executing package.

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

In a nested execution scenario, where one package invokes another, the PACKAGE_NAME global variable contains the name of the immediate package context. For example, if package A checks the value of the PACKAGE_NAME variable, the value is A. If package A invokes package B and package B checks the value of the PACKAGE_NAME variable, the value is B.