View previous topic :: View next topic
|
Author |
Message |
rajmainframe
New User
Joined: 28 Nov 2006 Posts: 1 Location: bangalore
|
|
|
|
hi... this is raj ... doing course of ibm-mainframe i would like to know..
what are all the impacts we get in cobol pgm when i add some more fields to db2 table..
what are all changes i hv to make in cobol pgm...
plz ...reply |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Rajmainframe,
1) U need to change the dclgen for that table
2) Need to check how many program r using that table
3) IF program r inserting the values in the table then do we define not null for the newly added field then we nee to change insert query & recompile the pgm
4) IF program r having select on that table there can be two case
1) Program r not using that newly added field in that case recompilation is not need but suggest to recompile
2) Program r using newly added field than in that case u need to change in the query & recompile the program.
One more point if any of the program contain select * then u need to change the query to accommodate host variable to newly added field if u need them otherwise change the query to specifying the column name that was there previously in the table |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
Quote: |
3) IF program r inserting the values in the table then do we define not null for the newly added field then we nee to change insert query & recompile the pgm
|
I dont think we can define NOT NULL for newly added field |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi cobolunni,
Tell me whats the problem in defining the table as NOT NULL......
Thanks
Arun |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
because in case we are adding a new field to the table in which we had already added the values ,Our new column contains null value for all the rows
that we inserted so we cant specify notnull to our new column because the value of new column will be null for every row that we had added
also in the db2sql manual it is told that
alter add column-name type not null with default is only possible |
|
Back to top |
|
|
|