Environment and identifier functions

The following table describes the supported environment and identifier functions.

Function Description
CON_DBID_TO_ID Accepts a container DBID as an argument and returns the container ID. The argument should be a NUMBER or a value implicitly convertible to NUMBER.
CON_GUID_TO_ID Accepts a container GUID (globally unique identifier) as an argument and returns the container ID. Specify a raw value for container_guid. Returns a NUMBER value.
CON_NAME_TO_ID Takes a container name (as a string or an expression that resolves to a string of any data type) and returns the container ID as a NUMBER value.
CON_UID_TO_ID Takes a container UID (unique identifier) as an argument and returns the container ID as a NUMBER value. Specify a NUMBER value for container_uid or any value that can be implicitly converted to NUMBER.
ORA_INVOKING_USER Returns the name of the database user who invoked the current statement or view. In a definer’s rights context, it returns the owner of the definer’s rights object. For Real Application Security users, returns XS$NULL.
ORA_INVOKING_USERID Returns the identifier of the database user who invoked the current statement or view, considering the BEQUEATH property of intervening views referenced in the statement.
SYS_CONTEXT Returns the value of a parameter associated with the context namespace at the current moment. Can be used in both SQL and PL/SQL statements and must be executed locally.
SYS_GUID Generates and returns a globally unique 16-byte identifier (RAW value). Typically includes a host identifier, a process or thread identifier, and a nonrepeating value for that process or thread.
SYS_TYPEID Returns the typeid of the most specific type of the operand, primarily used to identify the type-discriminant column underlying a substitutable column. Can be used to build an index on the type-discriminant column.
UID Returns an integer that uniquely identifies the session user (the user who logged on).
USER Returns the name of the session user (the user who logged on). May change during the session if Real Application Security sessions are attached or detached. For enterprise users, returns the schema; for others, the database user name. If a Real Application Security session is attached, returns XS$NULL.
USERENV Returns information about the current session. This can be useful for creating an application-specific audit trail or determining the language-specific characters used by the session. USERENV cannot be used in the condition of a CHECK constraint.