System functions
Db2 supports system functions that are defined through vendor escape clauses.
The following rules apply to the arguments in these system functions:
- Arguments denoted as exp can be the name of a column, the result of another scalar function, or a literal.
- Arguments denoted as value can be a literal constant.
- DATABASE()
- Returns the name of the database corresponding to the connection handle (hdbc). (The name of the database is also available using SQLGetInfo() by specifying the information type SQL_DATABASE_NAME.)
- IFNULL( exp, value )
- If exp is null, value is returned. If exp is not null, exp is returned. The possible data types of value must be compatible with the data type of exp.
- USER()
- Returns the user's authorization name. (The user's authorization name is also available using SQLGetInfo() by specifying the information type SQL_USER_NAME.)