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

Add new column to table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GiridharanN

New User


Joined: 12 Apr 2007
Posts: 21
Location: Coimbatore

PostPosted: Fri Jan 15, 2010 5:54 pm
Reply with quote

Hi,

We are adding a new column at the end of the table.

Do we need to change or recompile any old programs that use this table but do not use the column.

The new column can hold null.

There are a few insert or update programs too that do not use this new column. Can the inserts work fine without us making any change.

We are not changing the declaration copybook.
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Fri Jan 15, 2010 5:59 pm
Reply with quote

Hello Giridharan,

Quote:
We are adding a new column at the end of the table.

Do we need to change or recompile any old programs that use this table but do not use the column.


Need not to change or recompile new program if you are not making use of new column but make sure that you dont have SELECT * in ur program
otherwise you need to change ur queries


Quote:
The new column can hold null.

There are a few insert or update programs too that do not use this new column. Can the inserts work fine without us making any change.

If new column is defined as Null in that case you need nt to change the queries if you dont want to insert any value for that new col
Back to top
View user's profile Send private message
GiridharanN

New User


Joined: 12 Apr 2007
Posts: 21
Location: Coimbatore

PostPosted: Fri Jan 15, 2010 8:24 pm
Reply with quote

Thank you so much!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 15, 2010 10:12 pm
Reply with quote

Hello,

Quote:
There are a few insert or update programs too that do not use this new column.
Then the new column should be defined with a specific default value. . .
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jan 15, 2010 10:29 pm
Reply with quote

Quote:
The new column can hold null.



Then the default is null.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 15, 2010 10:42 pm
Reply with quote

Hi Craig,

Quote:
Then the default is null.
Yup, but it is my policy/preference that things be specified. Also, another policy that i prefer is that any code that does an insert specifies a value for every column in the row (i'll concede to using the defined default, but do prefer this be specified in the code).

Speaking of preferences, every time i have the opportunity, i prevent the use of NULLs in a column. A neat theoretical capability, but almost always causes more confusion/complication than any benefit derived. . .
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top