totn Oracle Functions

Oracle / PLSQL: UID function

This Oracle tutorial explains how to use the Oracle/PLSQL UID function with syntax and examples.

Description

The Oracle/PLSQL UID function returns the id number for a user's session (the user who is currently logged in).

Syntax

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

UID

Parameters or Arguments

There are no parameters or arguments for the UID function.

Returns

The UID function returns a numeric value.

Applies To

The UID function can be used in the following versions of Oracle/PLSQL:

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

Example

Let's look at some Oracle UID function examples and explore how to use the UID function in Oracle/PLSQL.

For example:

SELECT UID
INTO parm_uid
FROM dual;

The variable called parm_uid will now contain the id number for the user's session. The value could be 25, for example.