Oracle® TimesTen In-Memory Database SQL Reference Release 11.2.1 Part Number E13070-03 |
|
|
View PDF |
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 |
---|---|
namespace |
Value: USERENV
Other values result in a return of NULL. |
parameter |
Supported values:
|
length |
Number between 1 and 4000 bytes. |
These are descriptions of the supported values for parameter
:
Parameter | 'Description |
---|---|
AUTHENTICATION_METHOD | Returns the method of authentication for these types of users:
|
CURRENT_USER | 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, CURRENT_USER returns the same value as SESSION_USER. When used directly in the body of a view definition, this returns the user that is executing the cursor that is using the view. It does not respect views used in the cursor as being definer's rights. |
CURRENT_USERID | The identifier of the database user whose privileges are currently active |
IDENTIFICATION_TYPE | Returns the way the user was created in the database. Specifically, it reflects the IDENTIFIED clause in the CREATE/ALTER USER syntax. In the list that follows, the syntax used during user creation is followed by the identification type returned:
|
LANG | The ISO abbreviation for the language name, a shorter form than the existing 'LANGUAGE' parameter. |
LANGUAGE | The language and territory currently used by your session, along with the database character set, in this form:
|
NLS_SORT | Binary or linguistic sort. |
SESSION_USER | The name of the database user at logon. This value remains the same throughout the duration of the session. |
SESSION_USERID | The identifier of the database user at logon. |
Description
The data type of the return value is VARCHAR2.
Examples
SELECT SYS_CONTEXT('USERENV', 'CURRENT_USER') FROM dual; < TTUSER > 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.