Output session roles from procedure : Role « User Previliege « Oracle PL / SQL






Output session roles from procedure

   
SQL>
SQL> create or replace procedure myProcedure
  2    authid current_user
  3    as
  4    begin
  5      for rec in (select * from session_roles)
  6      loop
  7        dbms_output.put_line(rec.role);
  8      end loop;
  9    end;
 10    /

Procedure created.

SQL> execute myProcedure
DBA
SELECT_CATALOG_ROLE
HS_ADMIN_ROLE
EXECUTE_CATALOG_ROLE
DELETE_CATALOG_ROLE
EXP_FULL_DATABASE
IMP_FULL_DATABASE
GATHER_SYSTEM_STATISTICS
SCHEDULER_ADMIN
XDBADMIN
XDBWEBSERVICES

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> drop procedure myProcedure;

Procedure dropped.

SQL>

   
    
    
  








Related examples in the same category

1.Creating a Role
2.define a role as a global role, which means that a user can only be authorized to use the role by an enterprise directory service.
3.use a password when a role is authorized by the database
4.Assign CONNECT and RESOURCE Roles
5.Assign Role to User
6.Drop Role
7.Get two database users and show their roles.
8.Grant Permissions to Role
9.Unassign Role