Oracle Database - CURRENT_USER, SESSION_USER

About

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

How to

Get the current value

To get the current value of:

use the userenv CONTEXT as below:

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

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


Powered by ComboStrap