Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96

    Unanswered: db2 session_user

    Hello,

    In DB2, we can grab the current session which we are using now, such as :

    db2 "select session_user from sysibm.sysdummy1"

    Is there any possibility to get the current user role instead of username?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    there is no such meaning as 'current user role' in db2.
    You can get a list of roles for the current user using the following function:
    AUTH_LIST_ROLES_FOR_AUTHID
    Regards,
    Mark.

  3. #3
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96
    Hi Mark,
    Thanks for reply. I was using AUTH_LIST_ROLES_FOR_AUTHID earlier, but it is a table function which is not supported in Row Column Access Control.
    I found rolename in syscat.roleauth which able to work with RCAC.

    select ROLENAME FROM SYSCAT.ROLEAUTH
    WHERE GRANTEETYPE='U'
    AND GRANTORTYPE='U'
    AND GRANTEE=SESSION_USER

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •