Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 12th, 2006, 12:14 PM
dkazakov dkazakov is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 4 dkazakov User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 2 sec
Reputation Power: 0
"USE somedatabase" in Oracle

In MySQL when someone want to change the database, one can simply type "use <somedatabase>". But in Oracle, when one is executing for example "select"-statements, there are executed on the default schema(database/tablespace). So how can one switch from the default schema to some other.

For example, there are cases when one would like to import some data, not in the tables from the default schema, but in some other schema.

Reply With Quote
  #2  
Old April 13th, 2006, 03:04 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 8,040 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 6 Days 12 h 47 m 37 sec
Reputation Power: 281
The user must have proper grants on the other schema and must refer tables by schema_name.table_name

Reply With Quote
  #3  
Old April 13th, 2006, 03:09 AM
shammat shammat is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,022 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 22 h 2 m 3 sec
Reputation Power: 68
You can always do a SELECT * FROM owner.table.

You can also switch the current schema by using
ALTER SESSION SET CURRENT_SCHEMA = newschema;

What do you mean with "import some data, not in the tables from the default schema"

Thomas
Comments on this post
pabloj agrees!

Reply With Quote
  #4  
Old April 13th, 2006, 08:46 AM
dkazakov dkazakov is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 4 dkazakov User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 2 sec
Reputation Power: 0
Thank you shammat

altering the current schema, works good in my case

With "import some data, not in the tables from the default schema"
I meant, that the I didn't want the user to import the data in the tables in the current schema, but in some other schema. And by altering the current schema it works . Thank you, you saved me much time finding it out .

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > "USE somedatabase" in Oracle


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT