Mega Code Archive

 
Categories / Oracle PLSQL / User Previliege
 

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>