View previous topic :: View next topic |
Author |
Message |
srini_igsi Beginner

Joined: 12 May 2006 Posts: 41 Topics: 16 Location: Mumbai
|
Posted: Wed May 17, 2006 8:26 am Post subject: Will be there any issue if a new column is added |
|
|
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 |
|
 |
schintala Beginner
Joined: 18 May 2005 Posts: 108 Topics: 31 Location: USA
|
Posted: Wed May 17, 2006 10:28 am Post subject: |
|
|
You will have to rebind your program and it it requires you may have to change your application program. |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Wed May 17, 2006 10:40 am Post subject: |
|
|
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 |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Wed May 17, 2006 12:10 pm Post subject: |
|
|
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 |
|
 |
Manas Biswal Intermediate

Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Wed May 17, 2006 3:28 pm Post subject: |
|
|
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 |
|
 |
srini_igsi Beginner

Joined: 12 May 2006 Posts: 41 Topics: 16 Location: Mumbai
|
Posted: Thu May 18, 2006 4:45 am Post subject: |
|
|
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 |
|
 |
Manas Biswal Intermediate

Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
|
Back to top |
|
 |
a_seshu Beginner

Joined: 30 Sep 2004 Posts: 16 Topics: 4 Location: Chennai
|
Posted: Thu May 18, 2006 2:53 pm Post subject: |
|
|
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 |
|
 |
|
|