Oracle Database - CURRENT_SCHEMA

Card Puncher Data Processing

About

When a session starts, CURRENT_SCHEMA has the value of the schema owned by SESSION_USER.

How to

Get the current value

To get the current value of CURRENT_SCHEMA, CURRENT_USER, or SESSION_USER, use the userenv context:

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

Modify it

CURRENT_SCHEMA can be changed during the session with the SQL statement ALTER SESSION SET CURRENT_SCHEMA.

ALTER SESSION SET CURRENT_SCHEMA = MY_SCHEMA;

MY_SCHEMA without quote.

Oracle recommends against issuing ALTER SESSION SET CURRENT_SCHEMA from in a stored PL/SQL unit.





Discover More
Card Puncher Data Processing
Oracle Database - AUTHID

The AUTHID property of a stored PL/SQL unit affects the name resolution and privilege checking of SQL statements that the unit issues at run time. The AUTHID property does not affect compilation, and has...
Card Puncher Data Processing
Oracle Database - CURRENT_USER, SESSION_USER

When a session starts, CURRENT_USER has the same value as SESSION_USER and give the user id To get the current value of: CURRENT_SCHEMA, CURRENT_USER, or SESSION_USER use the userenv CONTEXT...
Card Puncher Data Processing
Oracle Database - Schema

A schema is a logical collection of schema objects all of which are owned by a user.
Card Puncher Data Processing
Oracle Database - Userenv (Current Session Informations)

Userenv is a pre-build context that describes the current session. You can query the context Userenv with two functions. the SYS_CONTEXT...



Share this page:
Follow us:
Task Runner