Identifier functions v17
Identifier functions that information about the instance and session.
SYS_GUID
The SYS_GUID
function generates and returns a globally unique identifier. The identifier takes the form of 16 bytes of RAW
data. The SYS_GUID
function is based on the uuid-ossp
module to generate universally unique identifiers. The signature is:
Example
This example adds a column to the table EMP
, inserts a unique identifier, and returns a 16-byte RAW
value:
USERENV
The USERENV
function retrieves information about the current session. The signature is:
The parameter
specifies a value to return from the current session. The table shows the possible parameter
values.
Parameter | Description |
---|---|
ISDBA | Returns TRUE if the current user has DBA privileges, otherwise FALSE . |
LANGUAGE | The language, territory, and character set of the current session in the following format: language_territory.characterset |
LANG | The ISO abbreviation for the language name, a short name for the existing LANGUAGE parameter. |
SID | The current session identifier. |
TERMINAL | The current session's operating system terminal identifier. |
Examples
This example returns the ISDBA
parameter of the current session:
This example returns the LANG
parameter of the current session:
This example returns the LANGUAGE
parameter of the current session:
This example returns the TERMINAL
identifier:
This example returns the SID
number of the current session:
SYS_CONTEXT
The SYS_CONTEXT
function returns the value of a parameter
associated with the context namespace
in the current session. The signature is:
Or
Parameters
namespace
namespace
can be any named context. USERENV
is a built-in context that shows information about the current session.
parameter
The parameter
is a defined attribute of a namespace. The following table lists predefined attributes of the USERENV
namespace.
Parameter | Description |
---|---|
ISDBA | Returns TRUE if the current user has DBA privileges, otherwise FALSE . |
LANGUAGE | The language, territory, and character set of the current session in the following format: language_territory.characterset |
LANG | The ISO abbreviation for the language name, a short name for the existing LANGUAGE parameter. |
SID | The current session identifier. |
TERMINAL | The current session's operating system terminal identifier. |
Examples
In these examples, the built-in USERENV
namespace is used with the SYS_CONTEXT
function.
This example returns the ISDBA
parameter of the current session:
This example returns the LANG
parameter of the current session:
This example returns the LANGUAGE
parameter of the current session:
This example returns the TERMINAL
identifier:
This example returns the SID
number of the current session:
- On this page
- SYS_GUID
- USERENV
- SYS_CONTEXT