SYS_CONTEXT
Returns information about the current session.
The data type of the return value is VARCHAR2
.
SQL syntax
SYS_CONTEXT('namespace', 'parameter' [, length ])
Parameters
SYS_CONTEXT
has the parameters:
Parameter | Description |
---|---|
|
Value: Other values result in a return of |
|
Supported values:
|
|
Length in bytes, from 1 to 4000. |
These are descriptions of the supported values for parameter
:
Parameter | Description |
---|---|
|
Identifies the position in the module (application name) and is set through OCI. |
|
Returns the method of authentication for these types of users:
|
|
Returns the user session information that can be stored by an application through OCI. |
|
The name of the currently active database schema. This may change during the duration of a session to reflect the owner of any active definer's rights object. When used directly in the body of a view definition, this returns the default schema used when executing the SQL statement that is using the view. It does not respect views used in the SQL statement as having definer's rights.
|
|
The name of the database user whose privileges are currently active. This may change during the duration of a session to reflect the owner of any active definer's rights object. When no definer's rights object is active, |
|
The identifier of the database user whose privileges are currently active. |
|
Returns the way the user was created in the database. Specifically, it reflects the
|
|
The ISO abbreviation for the language name, a shorter form than the existing |
|
The language and territory currently used by the session, along with the database character set, in this form:
|
|
The application name (module) set through OCI. |
|
Binary or linguistic sort. |
|
The name of the database user at logon. This value remains the same throughout the duration of the session. |
|
The identifier of the database user at logon. |
|
The connection ID of the current connection. |
Description
The data type of the return value is VARCHAR2
.
Examples
SELECT SYS_CONTEXT('USERENV', 'CURRENT_USER') FROM dual; < TERRY > 1 row found. SELECT SYS_CONTEXT('USERENV', 'LANGUAGE') FROM dual; < AMERICAN_AMERICA.AL32UTF8 > 1 row found. SELECT SYS_CONTEXT('USERENV', 'IDENTIFICATION_TYPE') FROM dual; < EXTERNAL > 1 row found.