dbTalk Databases Forums  

SQL Query with Schema

comp.databases comp.databases


Discuss SQL Query with Schema in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Amardeep Verma
 
Posts: n/a

Default SQL Query with Schema - 07-29-2003 , 03:11 AM






Hi,
We are developing an application may access ORACLE or DB2. For
our application there will be a Schema, dedicated specifically to it
only. Let Us Call this Schema as SCH1. It will have 7 tables. Tab1 to
Tab7. In Oracle we can write the query

Select SCH1.Tab1.* from SCH1.Tab1 where SCH.Tab1..........

This will return columns from Tab1 in SCH1. Please note that there
might be Tables named Tab1 in other Schemas also. And there definetly
will be other Schemas in the Database. Similarly we can get details
from other Tables in Schema1, by simply replacing the "Tab1" with
"Tab2", "Tab3", and so on.

My question is this, will the above mentioned Query work with IBM
DB2? Or will I have to write a "SET CURRENT SCHEMA=SCH1" and then
write the query.

Thanks in Advance for your help
Amardeep Verma

Reply With Quote
  #2  
Old   
Knut Stolze
 
Posts: n/a

Default Re: SQL Query with Schema - 07-29-2003 , 04:00 AM






Amardeep Verma <addverma (AT) email (DOT) com> wrote:

Quote:
Hi,
We are developing an application may access ORACLE or DB2. For
our application there will be a Schema, dedicated specifically to it
only. Let Us Call this Schema as SCH1. It will have 7 tables. Tab1 to
Tab7. In Oracle we can write the query

Select SCH1.Tab1.* from SCH1.Tab1 where SCH.Tab1..........

This will return columns from Tab1 in SCH1. Please note that there
might be Tables named Tab1 in other Schemas also. And there definetly
will be other Schemas in the Database. Similarly we can get details
from other Tables in Schema1, by simply replacing the "Tab1" with
"Tab2", "Tab3", and so on.

My question is this, will the above mentioned Query work with IBM
DB2? Or will I have to write a "SET CURRENT SCHEMA=SCH1" and then
write the query.
The query will work as shown above.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.