DBMS_SESSION.IS_ROLE_ENABLED : dbms_session « System Packages « Oracle PL/SQL Tutorial






SQL>
SQL> BEGIN
  2     IF DBMS_SESSION.IS_ROLE_ENABLED('ADMINSTRATOR') THEN
  3        DBMS_OUTPUT.PUT_LINE('Current Role Administrator');
  4     ELSIF DBMS_SESSION.IS_ROLE_ENABLED('MANAGER') THEN
  5        DBMS_OUTPUT.PUT_LINE('Current Role Manager');
  6     ELSE
  7        DBMS_OUTPUT.PUT_LINE('Current Role Operator');
  8        
  9     END IF;
 10  END;
 11  /
Current Role Operator

PL/SQL procedure successfully completed.

SQL>
SQL>








31.24.dbms_session
31.24.1.dbms_session.set_context
31.24.2.DBMS_SESSION.IS_ROLE_ENABLED
31.24.3.DBMS_SESSION.SET_SQL_TRACE
31.24.4.Use dbms_session.AppCtxTabTyp and dbms_session.list_context to display context