PolarDB for Oracle provides the DBMS_SESSION.SET_ROLE stored procedure.
Functions and stored procedures
|Function or stored procedure||Return value type||Description|
The DBMS_SESSION stored procedure in PolarDB for Oracle is partially implemented when compared with Oracle's version. Only DBMS_SESSION.SET_ROLE is supported.
The SET_ROLE stored procedure sets the current session user to the role specified
role_cmd. After the current session invokes the SET_ROLE stored procedure, the session uses
the permissions assigned to the specified role. The syntax for this stored procedure:
The SET_ROLE stored procedure appends the value specified for
role_cmd to the
SET ROLE statement, and then invokes the statement.
|role_cmd||Specifies a role name in the form of a string value.|
The following example demonstrates a call to the SET_ROLE stored procedure which uses
SET_ROLE statement to set the identity of the current session user to manager.