Start of change

SQL_CHECK_FUNCTION_USAGE scalar function

The SQL_CHECK_FUNCTION_USAGE scalar function returns an indication of whether the effective user of the thread is authorized to the specified function usage identifier, either directly, as a member of a group profile, or through adopted authority.

The validation is performed using the Check User Function Usage (QSYCKUFU, QsyCheckUserFunctionUsage) API. The usage setting for the user, the user's group, the default usage value, and the allow *ALLOBJ indicator for the function usage identifier are taken into account.

Authorization: None required.

Read syntax diagramSkip visual syntax diagramSQL_CHECK_FUNCTION_USAGE(FUNCTION_USAGE => function-usage )
The schema is QSYS2.
function-usage
A character string containing one function usage identifier.

The result of the function is INTEGER.

The function returns the following values:
0
The user is not authorized to the function usage identifier.
1
The user is authorized to the function usage identifier.

Example

  • Check whether the current user is authorized to the QIBM_DB_SQLADM function usage identifier.
    VALUES SQL_CHECK_FUNCTION_USAGE('QIBM_DB_SQLADM');
End of change