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

impacts on cobol prgm when feilds r added to db2 table


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajmainframe

New User


Joined: 28 Nov 2006
Posts: 1
Location: bangalore

PostPosted: Thu Nov 30, 2006 12:24 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Nov 30, 2006 12:38 pm
Reply with quote

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
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Thu Nov 30, 2006 1:40 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Nov 30, 2006 7:39 pm
Reply with quote

Hi cobolunni,

Tell me whats the problem in defining the table as NOT NULL......

Thanks

Arun
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Fri Dec 01, 2006 4:52 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top