Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Changing the default schema for a session

Changing the default schema for a session

From: <Don=Hall%NA%Contractors_at_netgate.compaq.com>
Date: 1997/04/17
Message-ID: <01bc4b44$c380f8c0$3c261cac@honewil.cs.hou.compaq.com>#1/1

Somewhere among the many Oracle reference books I ran across an undocumented command that allows a user session to change the default session schema.
Scenario...user1 establishes a connection via SQLPLUS

to select from table1 owned by user1 the command is

	select * from table1 or
	select * from user1.table  (not necessary to specify schema is this case)

in order for user1 to select from table2 owned by user2 the command is
	select * from user2.table2 (assuming no synonym and granted privileges)

There is a command that user1 can issue that is something like
  	Alter session set schemaname =  user2
Now, even though connected as user1, the session uses user2 as the default schema and user1 can now issue the command as

        select * from table2

Is anyone familiar with this particular command, and do you know the correct syntax? Received on Thu Apr 17 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US