doc-exports/docs/dli/sqlreference/dli_08_0143.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2024-03-27 22:02:33 +00:00

4.7 KiB

Displaying a Role

Function

This statement is used to display all roles or roles bound to the user_name in the current database.

Syntax

1
SHOW [ALL] ROLES [user_name];

Keywords

ALL: Displays all roles.

Precautions

Keywords ALL and user_name cannot coexist.

Example

  • To display all roles bound to the user, run the following statement:
    1
    SHOW ROLES;
    
  • To display all roles in the project, run the following statement:
    1
    SHOW ALL ROLES;
    

    Only the administrator has the permission to run the show all roles statement.

  • To display all roles bound to the user named user_name1, run the following statement:
    1
    SHOW ROLES user_name1;