Authorization required for global variables

To access a global variable, the authorization ID requires certain privileges or DATAACCESS authority.

Schema global variables

To retrieve the value of a schema global variable, the authorization ID of the statement must have one of these authorizations:
  • READ privilege on the schema global variable
  • DATAACCESS authority
To specify a schema global variable as the target of a value assignment, the authorization ID of the statement must have one of these authorizations:
  • WRITE privilege on the schema global variable
  • DATAACCESS authority

Module global variables

If a module global variable is published and is then referenced from outside the module that defined it, the authorization ID of the statement must have one of these authorizations:
  • EXECUTE privilege on the module in which the global variable is defined
  • DATAACCESS authority

References to module global variables from objects that are defined within the same module as the global variable do not require any authorizations to be held by the authorization ID of the statement.