USER Function in Oracle SQL – PLSQL

The USER function in Oracle SQL / PLSQL is used to retrieve the user id of the current Oracle Session.

Syntax for the USER function in Oracle SQL / PLSQL is:

SELECT USER
FROM table_name;

Example:

Using USER function to retrieve the user name for the current session

[sourcecode language=”sql”]
SELECT USER
FROM dual; [/sourcecode]

Will return the name of the user logged in the current Oracle Session e.g. “System” or “Scott”.


Leave a Reply

Your email address will not be published. Required fields are marked *