MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dynamically changing accessed DB2 tables

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Wed Apr 11, 2012 2:54 pm    Post subject: Dynamically changing accessed DB2 tables Reply with quote

I hope I can explain this well enough so everyone can understand.

We have a client/system that used VB6 and Cobol/DL/1. Recently, we had to convert the VB6 code to .net. At the same time, it was important that any errors in the .net code didn't screw up the "real" DL/1 test database. What we did was to create copies of the database and then change the PSB with it's PCB's and AIB names so that the code could "choose" to which database it should write based on variations of the client userid. All well and good.

Now we're going to convert from DL/1 to DB2 and I'm wondering if there is some "simple" method of being able to switch between DB2 databases ? I'm not sure if it's standard, but at work, all our cobol/DB2 code is written along the lines of
Code:
select etc etc
       from K46A01AA

where K46A01AA is an alias for the real table name.

Theoretically, we could have copies of K46A0100 such as K46B0100, but I envisage problems along the following lines. Someone is testing and their results show no rows. They look in K46A0100 and there's at least one there. Trouble is, their package is bound against K46B0100 which doesn'thave any rows.

You can see the problems that can arise.

So - is there any method for switching between DB2 tables in a simple manner that anyone can suggest ?
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Apr 11, 2012 5:11 pm    Post subject: Reply with quote

two schema's in the same task? or just potentially a different schema for each transaction?

and you are on a y/OS mainframe?????
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Thu Apr 12, 2012 3:05 am    Post subject: Reply with quote

If you are relative new to DB2, look at the concept of packages and collections. What you want to achieve, switching between test databases, is done best with binding the dbrms into multiple collections, while one collection uses one table creator-id.

If you now create different plans, each using one of the collections, you switch between your test databases by using different plans during the start of your application.

This concept is very powerful, but you need some reading to feel comfortable with it.

regards
Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group