Oracle ORA_INVOKING_USER() Function

Oracle ORA_INVOKING_USER is a built-in function that returns the name of the database user that invoked the current statement or view.

Oracle ORA_INVOKING_USER Syntax

Here is the syntax for the Oracle ORA_INVOKING_USER function:

ORA_INVOKING_USER

Parameters

The Oracle ORA_INVOKING_USER function does not require any parameters.

Return Value

The Oracle ORA_INVOKING_USER function returns the name of the database user that invoked the current statement or view.

If this function is called from the context of a definer’s rights object, it returns the name of the definer’s rights object owner. If the calling user is a Real Application Security user, it returns the user XS$NULL.

Oracle ORA_INVOKING_USER Examples

Here are some examples that demonstrate the usage of the Oracle ORA_INVOKING_USER function.

Basic Usage

The following statement retrieves the name of the user that invoked the current statement:

SELECT
    ORA_INVOKING_USER
FROM dual;

Output:

ORA_INVOKING_USER
____________________
SYSTEM

Conclusion

Oracle ORA_INVOKING_USER is a built-in function that returns the name of the database user that invoked the current statement or view.