JOB_NAME & SERVER_MODE_JOB_NAME - Db2 built-in global variables
With IBM i 7.2, Db2 for i added a new type of resource in the form of database supplied built-in global variables.
A global variable can be referenced anywhere that a column name is permitted within an SQL statement.
A built-in global variable is special because the database is responsible for providing the value contained within the variable and users are unable to modify (SET) the variable to a different value.
The new built-in global variables are:
- QSYS2/JOB_NAME - returns the qualified job name of the job where the SQL statement is executed.
- QSYS2/SERVER_MODE_JOB_NAME - Applies only to QSQSRVR jobs and returns the qualified job name application job which owns the SQL Server Mode connection. When referenced outside of a QSQSRVR job, the NULL value is returned.
13 January 2020