USERENV
Syntax
Purpose
Note:
USERENV
is a legacy function that is retained for backward compatibility. Oracle recommends that you use the SYS_CONTEXT
function with the built-in USERENV
namespace for current functionality. See SYS_CONTEXT for more information.
USERENV
returns information about the current session. This information can be useful for writing an application-specific audit trail table or for determining the language-specific characters currently used by your session. You cannot use USERENV
in the condition of a CHECK
constraint. Table 7-12 describes the values for the parameter
argument.
All calls to USERENV
return VARCHAR2
data except for calls with the SESSIONID
, SID
, and ENTRYID
parameters, which return NUMBER
.
Table 7-12 Parameters of the USERENV Function
Parameter | Return Value |
---|---|
|
Caution: Some commercial applications may be using this context value. Refer to the applicable documentation for those applications to determine what restrictions they may impose on use of this context area. See Also: Oracle Database Security Guide for more information on application context, CREATE CONTEXT, and SYS_CONTEXT |
|
The current audit entry number. The audit entryid sequence is shared between fine-grained audit records and regular audit records. You cannot use this attribute in distributed SQL statements. |
|
|
|
|
|
language_territory.characterset |
|
|
|
|
|
|
See Also:
Appendix C in Oracle Database Globalization Support Guide for the collation derivation rules, which define the collation assigned to the character return value of USERENV
Examples
The following example returns the LANGUAGE
parameter of the current session:
SELECT USERENV('LANGUAGE') "Language" FROM DUAL; Language ----------------------------------- AMERICAN_AMERICA.WE8ISO8859P1