PACKAGE_SCHEMA global variable

This built-in global variable contains the schema 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_SCHEMA global variable contains the schema name of the immediate package context. For example, if package X.A checks the value of the PACKAGE_SCHEMA variable, the schema value is X. If package X.A invokes package Y.B and package B checks the value of the PACKAGE_SCHEMA variable, the schema value is Y.