Skip Headers
Oracle® OLAP DML Reference
11g Release 1 (11.1)

Part Number B28126-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

SYS_CONTEXT

The SYS_CONTEXT function returns the value of parameter associated with the context namespace.

See also:

For more information, see the SYS_CONTEXT function in Oracle Database SQL Language Reference.

Return Values

VARCHAR2.

Syntax

SYS_CONTEXT(namespace, parameter [, length ])

Arguments

namespace

A text expression that specifies a namespace which is a valid SQL identifier. The context namespace must already have been created, and the associated parameter and its value must also have been set using the DBMS_SESSION.set_context procedure.

parameter

A text expression that specifies an attribute associated with a namespace. This parameter and its value must have previously been set using the DBMS_SESSION.set_context procedure. The parameter is not case sensitive, but it cannot exceed 30 bytes in length.

length

A numeric expression that specifies the maximum size of the return value. The value that you specfy must be a NUMBER (or a value that can be implicitly converted to NUMBER) and in the range of 1 to 4000 bytes,. If you specify an invalid value, then Oracle OLAP ignores it and uses the default value of 256 bytes..

Notes

USERENV Built-In Namespace

Oracle provides a built-in namespace called USERENV, which describes the current session. For more information on the predefined parameters of namespace USERENV, see the SYS_CONTEXT function in Oracle Database SQL Language Reference.

Examples

Example 8-125 Retrieving the Name of the User of the Session

The following hypothetical example retrieves the value JOHNSMITH which is the name of the user who logged onto the database.

SHOW SYS_CONTEXT ('USERENV', 'SESSION_USER')
JOHNSMITH