Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting current UserID

Status
Not open for further replies.

Blackhawks4Life

Programmer
Joined
Jul 9, 2013
Messages
3
Location
US
I have a trigger that I was using the following script to get the current UserID. We recently upgraded from Oracle 10g to 11g and now this query is returning NULL for both values. What I have found is that the SQL_ID in the V_$SESSION table is not being populated.

I am using Toad For Oracle on an Oracle 11g server.
Code:
SELECT SESS.OSUSER
    ,SESS.MACHINE
INTO v_USERID
    ,v_USERNAME
FROM SYS.V_$SQLAREA SEQL
JOIN SYS.V_$SESSION SESS ON SEQL.SQL_ID = SESS.SQL_ID
WHERE SEQL.SQL_TEXT LIKE 'DELETE%'
AND SEQL.SQL_TEXT LIKE '%ACCTLOG%';


Is there another option to get the UserID or another way to link to the V_$SESSION table?

We are using a Trigger because all of the query operations are passed in through a third party user software. There is only one login for the application so I needed to get to the individual PC information for the user.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top