View previous topic :: View next topic
|
Author |
Message |
GiridharanN
New User
Joined: 12 Apr 2007 Posts: 21 Location: Coimbatore
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
GiridharanN
New User
Joined: 12 Apr 2007 Posts: 21 Location: Coimbatore
|
|
|
|
Thank you so much! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Quote: |
The new column can hold null. |
Then the default is null. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|