The MON_GET_APPLICATION_HANDLE scalar function returns the application handle of the invoking application. The data type of the result is BIGINT.
The schema is SYSPROC.
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
The MON_GET_APPLICATION_HANDLE scalar function can be used to pass in the application handle of the current session into monitoring functions which filter based on the application handle, such that the session can access its own monitoring information. For example:
select application_handle, application_name, application_id, member, rows_read
from table(sysproc.mon_get_connection(sysproc.mon_get_application_handle(), -1))
as conn
The following is an example of output from this query.
APPLICATION_HANDLE APPLICATION_NAME APPLICATION_ID MEMBER
-------------------- ----------------- ------------------------------- -------
644 db2bp *LOCAL.amurchis.110831180720 0
ROWS_READ
----------
0
1 record(s) selected.