IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Accessing 2 tables from 2 different schema


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ManSab

New User


Joined: 23 Sep 2006
Posts: 13
Location: Pune

PostPosted: Thu Apr 05, 2007 10:16 am
Reply with quote

Generally when we write the SQL query in COBOL program we do not prefix the qualifier (owner) name along with the table name. If we have to access 2 tables which belong to 2 differnet owners then how to specify that and where?
Back to top
View user's profile Send private message
senthilssg

New User


Joined: 09 Dec 2005
Posts: 64
Location: USA

PostPosted: Thu Apr 05, 2007 10:51 am
Reply with quote

Hi ,

If you want access the two tables with different schema in your query then you will have to explicitly specify the schema name for table in query itself .

Code:

select * from schema1.table1 where col1 in ( select col1 from schema2.table2 ) ;



Regards
Senthil
Back to top
View user's profile Send private message
Shobana Bhaskar

New User


Joined: 02 Mar 2007
Posts: 35
Location: Pennsylvania, US

PostPosted: Mon Apr 09, 2007 2:02 pm
Reply with quote

Hi,

In Cobol program, we cannot specify qualifier. Instead you should bind your program to the appropriate plan. You will have package collections that belongs to different regions. You should make use of the plan name for respective region while executing the program (through JCL - DSNPARM).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts Need to fetch data from so many DB2 t... DB2 9
No new posts Accessing ABENDCC in JCL JCL & VSAM 6
No new posts How to: PK does not exist in several ... DB2 6
No new posts Discrepancy b/w SYSIBM tables and BMC... DB2 0
Search our Forums:

Back to Top