Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Functions, 158 of 166


USERENV

Syntax

userenv::=


Text description of functions144a.gif follows
Text description of userenv

Purpose


Note:

USERENV is a legacy function that is retained for backward compatibility. Oracle Corporation 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 of VARCHAR2 datatype 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 6-11 describes the values for the parameter argument.

Table 6-11  USERENV Parameters
Parameter  Return Value 

'CLIENT_INFO

CLIENT_INFO returns up to 64 bytes of user session information that can be stored by an application using the DBMS_APPLICATION_INFO package. 

 

    Caution: Some commercial applications may be using this context value. Check the applicable documentation for those applications to determine what restrictions they may impose on use of this context area.

 

 

Oracle recommends that you use the application context feature or the SYS_CONTEXT function with the USERENV namespace. These alternatives are more secure and flexible.

 

'ENTRYID

ENTRYID returns available auditing entry identifier. You cannot use this attribute in distributed SQL statements. To use this keyword in USERENV, the initialization parameter AUDIT_TRAIL must be set to true.  

'INSTANCE

INSTANCE returns the instance identification number of the current instance.  

'ISDBA

ISDBA returns 'TRUE' if the user has been authenticated as having DBA privileges either through the operating system or through a password file. 

'LANG

LANG returns the ISO abbreviation for the language name, a shorter form than the existing 'LANGUAGE' parameter. 

'LANGUAGE

LANGUAGE returns the language and territory currently used by your session along with the database character set in this form:

language_territory.characterset
 

'SESSIONID

SESSIONID returns your auditing session identifier. You cannot use this attribute in distributed SQL statements. 

'TERMINAL

TERMINAL returns the operating system identifier for your current session's terminal. In distributed SQL statements, this attribute returns the identifier for your local session. In a distributed environment, this is supported only for remote SELECT statements, not for remote INSERT, UPDATE, or DELETE operations. 

Example

The following example returns the LANGUAGE parameter of the current session:

SELECT USERENV('LANGUAGE') "Language" FROM DUAL;

Language
-----------------------------------
AMERICAN_AMERICA.WE8DEC

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback