Check session role form trg/proc

From: (wrong string) ård <rune_at_lis.pitt.edu>
Date: 1995/11/17
Message-ID: <48hnok$1s3_at_oslo-nntp.eunet.no>#1/1


I can't figure out how to retrieve the session role from a trigger (or procedure).
The SESSION_ROLES view gives zero rows back when i run it inside a trigger, but from sql*plus it works fine (of course)..

I have also tried to use the USER_ROLE_PRIVS view, but it will only give me the role of the owner and not the current user.

Look at my simple example under of how I have done it in my trigger..

-Rune

DECLARE
   CURSOR session_cur IS
   select role from session_roles;
   rolename session_roles.ROLE%TYPE;

BEGIN  open session_cur;
 loop
   FETCH session_cur INTO rolename;
   EXIT WHEN session_cur%NOTFOUND;
   dbms_output.put_line(rolename);
 end loop;
 close session_cur;

Received on Fri Nov 17 1995 - 00:00:00 CET

Original text of this message