Oracle SQL - CURRENT_SCHEMA Setting

Introduction

The ALTER SESSION command can save you the effort of prefixing object names with their schema name without using synonyms.

To use schema SCOTT which has the dept table, and suppose you are currently connected as database user BOOK.

You can use the ALTER SESSION command.

SQL> alter session set current_schema=scott;
Session altered.

SQL> show user
USER is "BOOK"

SQL> select * from dept;

SQL> alter session set current_schema=book;
Session altered.

Related Topic