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 

Will be there any issue if a new column is added

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


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Wed May 17, 2006 8:26 am    Post subject: Will be there any issue if a new column is added Reply with quote

Hi,

A COBOL-DB2 pgm is accessing a table say T1, and is working fine today.
So my question is if a new column is added to the table T1, whats the procedure to follow up? If it is already posted pl provide me the link.
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
schintala
Beginner


Joined: 18 May 2005
Posts: 108
Topics: 31
Location: USA

PostPosted: Wed May 17, 2006 10:28 am    Post subject: Reply with quote

You will have to rebind your program and it it requires you may have to change your application program.
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed May 17, 2006 10:40 am    Post subject: Reply with quote

Srini_igsi,

Suppose you had two columns say A and B in table T1 and your application program is running fine.Now think that u have added one more column say C to the table .So if you are simply making use of the program with the two columns A and B only for selecting / inserting / deleting / updating ,it is fine but you have to rebind the COBOL-DB2 program before your run because the program has to pick up the latest load module.

However,if in your code your are making use of the third column then you have to pre-compile, bind and then run to get the desired output.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed May 17, 2006 12:10 pm    Post subject: Reply with quote

Do not forget the programs having SELECT * queries for the table ! Or, your jobs that might be running SELECT * type of queries.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Wed May 17, 2006 3:28 pm    Post subject: Reply with quote

Not so fast here guys. If you add a column to the table by dropping and recreating the table, then of course you have to rebind your appl plan/package. But if you are adding a column to the table by using ALTER TABLE, then a rebind may not be necessary if you are not changing your appl code. There are a lot of exceptions to that also. I am a bit fuzzy on that since I anyway rebind all my packages whenever there is a structure change to any table.
But to answer Srini's original question -
1. If you are adding a column by dropping/recreating the table, rebind of all appl packages/plans is necessary.
2. If you are adding a column by using ALTER TABLE, rebind may not be necessary if you are not changing your appl code. But a rebind is always recommended.

HTH..Regards,
Manas
_________________
There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948)
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
srini_igsi
Beginner


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Thu May 18, 2006 4:45 am    Post subject: Reply with quote

If a column is Deleted from the Table..?? As per my knowledge the process is same as like Adding a new column .. rt??
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu May 18, 2006 12:39 pm    Post subject: Reply with quote

srini_igsi,

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAPH11/CCONTENTS?DT=20010710165542

Regards,
Manas
_________________
There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948)
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
a_seshu
Beginner


Joined: 30 Sep 2004
Posts: 16
Topics: 4
Location: Chennai

PostPosted: Thu May 18, 2006 2:53 pm    Post subject: Reply with quote

Say a table T1 is having columns A and B and your application program A1 is referring to the columns A and B by SELECT A,B from T1.

Now assuming the table is modified using the ALTER TABLE command to add a column C, the application program A1 need not be rebound if the column C doesnt allow default values.

If the column C is allowing default values still you need to rebind your application program A1. e.g. if you are adding a date column C with current date as default date.
_________________
I dont think I would ever stop learning. - Seshu.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
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