|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
"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. |
|
#2
|
||||
|
||||
|
The user must have proper grants on the other schema and must refer tables by schema_name.table_name
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 . |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > "USE somedatabase" in Oracle |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|