Start of change

Built-in global variables

This chapter contains semantic descriptions, rules, and examples of the use of the built-in global variables.

Built-in global variables are provided with the database manager and are used in SQL statements to retrieve scalar values associated with the variables.

As an example, the ROUTINE_TYPE global variable can be referenced in an SQL statement to retrieve the current routine type.

The authorization ID of any statement that retrieves the value of the global variable is required to have the READ privilege on the global variable and the system authority *EXECUTE on the library containing the global variable.

Example

To access the global variable CLIENT_HOST, run the following query:
  SELECT SYSIBM.CLIENT_HOST 
  FROM SYSIBM.SYSDUMMY1
The query returns the host name of the current client.
hotellnx93
End of change