About
Userenv is a pre-build context that describes the current session.
Articles Related
How to
Query it
You can query the context Userenv with two functions.
- the SYS_CONTEXT function
SELECT SYS_CONTEXT('USERENV','SESSIONID') FROM DUAL;
- or the USERENV function Deprectaed
SELECT USERENV('SESSIONID') FROM DUAL;
Get the Parameters
You can see all the SYS_CONTEXT parameters in the SQL documentation. Predefined Parameters of Namespace USERENV
CURRENT_SCHEMA
current_user
LANGUAGE
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8ISO8859P1
It gives the session's <language>_<territory> but the DATABASE character set, so the value returned is not the client's NLS_LANG setting!