Start of change

Built-in global variables

Db2 provides several built-in global variables.

CLIENT_IPADDR
Contains the value of the client IP address for the connection. For remote client connections, the value is the host IP address of the application that is used to establish the connection. For local host applications, the value is NULL. For remote host applications, the value is the IP address that is associated with the Db2 subsystem used to establish the connection as shown by issuing the -DISPLAY DDF command.

This global variable has the following characteristics:

  • It is read only, with values maintained by the system.
  • The type is CHAR(39).
  • The schema is SYSIBM.
  • The scope of this global variable is session.

The value is set by Db2 as obtained from the network. If the client did not connect by using the TCP/IP or SSL protocol, the value of the global variable is NULL.

1111:2222:3333:4444:5555:6666:7777:8888
Or IPv4-mapped IPv6 format:
::FFFF:9.30.115.135
Related information:
GET_ARCHIVE
Contains a string value that indicates whether a reference to an archive-enabled table in a table-reference should include rows in the associated archive table.

This global variable is defined with the following characteristics:

  • It is updatable, with values maintained by the user.
  • The type is CHAR(1).
  • The schema is SYSIBMADM.
  • The scope of this global variable is session.
The global variable can be set to the following:
Y
Specifies that when a table-reference is an archive-enabled table, the table reference includes rows in the associated archive table.

If the SYSIBMADM.GET_ARCHIVE global variable is set to 'Y' and the ARCHIVESENSITIVE bind option is set to 'Y', an archive-enabled table cannot be referenced in an SQL table function or in the definition of a row permission or column mask that is activated by a data change statement or query.

N
Specifies that when a table-reference is an archive-enabled table, the table reference does not include rows in the associated archive table. This is the default value.
MOVE_TO_ARCHIVE
Contains a string value that indicates whether the deletion of a row of an archive-enabled table should result in storing a copy of the deleted row in the associated archive table.

This global variable has the following characteristics:

  • It is updatable, with values maintained by the user.
  • The type is CHAR(1).
  • The schema is SYSIBMADM.
  • The scope of this global variable is session.

The global variable can be set to the following:

Y
Specifies that a delete of a row in an archive-enabled table will result in storing a copy of the deleted row in the associated archive table. Additionally, when the global variable is set to 'Y', an insert or update operation that specifies the archive-enabled table as the target of the statement will return an error.
E
Specifies that a delete of a row in an archive-enabled table will result in storing a copy of the deleted row in the associated archive table.
N
Start of changeSpecifies that a delete of a row in an archive-enabled table will not result in storing a copy of a deleted row in the associated archive table. End of change

Start of changeThe default value is determined from the value of the MOVE_TO_ARCHIVE_DEFAULT subsystem parameter in macro DSN6SPRM. End of change

End of change