Home » SQL & PL/SQL » SQL & PL/SQL » How to get the OS-User (10g)
How to get the OS-User [message #286126] Thu, 06 December 2007 09:25 Go to next message
novalex
Messages: 19
Registered: November 2007
Junior Member
Hello!

I want to get the OS-User. I already tried this:
SELECT SYS_CONTEXT('USERNAME', 'OS_USER') FROM DUAL

But I always get a NULL.
Is there another way to get the OS-User? Does it depend on the OS itself?
Hope you can help me.
Thanks.

bye
Alex
Re: How to get the OS-User [message #286129 is a reply to message #286126] Thu, 06 December 2007 09:32 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
SELECT OSUSER FROM V$SESSION;
Re: How to get the OS-User [message #286132 is a reply to message #286129] Thu, 06 December 2007 09:59 Go to previous message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Wrong SYS_CONTEXT parameters. It's

SELECT SYS_CONTEXT('USERENV', 'OS_USER') FROM DUAL
Previous Topic: Need to Split select statement column output into multiple lines
Next Topic: & sign in an SQL statement
Goto Forum:
  


Current Time: Sun Dec 04 22:40:52 CST 2016

Total time taken to generate the page: 0.11046 seconds