Oracle / PLSQL: USER function (Retrieving username)

This article is written about how to return the user_id in Oracle/PLSQL with syntax and examples.


The Oracle/PLSQL USER function returns the user_id from the cutting-edge Oracle session.


The syntax for the USER function in Oracle/PLSQL is:


Parameters or Arguments

There are no parameters or arguments for the USER function.


The USER function returns a string value.

Applies To

The USER feature can be used in the following versions of Oracle/PLSQL:

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i


Let’s look at some Oracle USER characteristic examples and explore how to use the USER characteristic in Oracle/PLSQL.

For example:

parm_user_ID := USER;


select USER
into parm_user_ID
from dual;

The variable called parm_user_ID will now comprise the Oracle consumer ID from the current Oracle session.