USERENV

USERENV is a function in SQL that provides access to specific session information. It can be used to retrieve the current session's user, language, and other details. This function returns a variety of values in a VARCHAR2 datatype related to your session environment.

Example

SELECT USERENV('LANGUAGE') FROM DUAL;

Output

'AMERICAN_AMERICA.UTF8'

Explanation

The ‘USERENV’ function provides information about the current session. In the example above, USERENV('LANGUAGE') returns the language and territory setting of the current session, along with the character set encoding value.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.