Oracle Database - CURRENT_USER, SESSION_USER

> Database > Oracle Database

1 - About

When a session starts, CURRENT_USER has the same value as SESSION_USER and give the user id

Advertising

3 - How to

3.1 - Get the current value

To get the current value of:

use the userenv CONTEXT as below:

SELECT sys_context('USERENV', 'CURRENT_USER') FROM dual;

3.2 - Change it

CURRENT_USER cannot be changed programmatically, but it might change when a PL/SQL unit or a view is pushed onto, or popped from, the call stack.

You can still change the current schema

db/oracle/current_user.txt · Last modified: 2017/09/06 19:27 by gerardnico