Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add new column to table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Add new column to table
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: 1187
Location: Bangalore,India

PostPosted: Fri Jan 15, 2010 5:59 pm    Post subject:
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Fri Jan 15, 2010 10:12 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jan 15, 2010 10:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us