The SYSCS_DIAG.CONTAINED_ROLES diagnostic table function returns all the roles contained within the specified role. The argument that is passed to this table function should be the name of the role, specified as a string in quotes, or the special keyword CURRENT_ROLE, which indicates the current role in effect. For a definition of role containment, see "Syntax for roles" in GRANT statement.
For example:
SELECT * FROM TABLE (SYSCS_DIAG.CONTAINED_ROLES('READER')) AS T1 SELECT * FROM TABLE (SYSCS_DIAG.CONTAINED_ROLES(CURRENT_ROLE)) AS T2
All users can access this diagnostic table function, whether or not the database has authentication and SQL authorization enabled.
The returned table has the column shown in the following table.
Column Name | Type | Length | Nullable | Contents |
---|---|---|---|---|
ROLEID | VARCHAR | 128 | false | The identifier of the role. |