If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 View and Application program

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-23-03, 12:11
Somesh Somesh is offline
Registered User
 
Join Date: Oct 2003
Posts: 1
DB2 View and Application program

Do we have to recompile an application program using a view when the base table for the view is modified (attribute added)? The new attribute is not used by the view.

This is for DB2 ver 7
Reply With Quote
  #2 (permalink)  
Old 10-23-03, 12:23
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
You did not state what operating system DB2 version 7 runs on.

As long as there is no 'select *' used (all columns are explicitly stated) in the view, then you do not have to recompile or rebind the program. Never use select * in an application program or in a view definition.
Reply With Quote
  #3 (permalink)  
Old 10-24-03, 03:02
RKrick RKrick is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 141
AFAIK, you don't need to recompile or rebind your program when you have a view with "select *" either. The problem is, the view doesn't get modified (the new columns are 'invisible' for the view) and this is sometimes confusing.
Just another cause not to use "select *" by defining views.
__________________
Rodney Krick
Reply With Quote
  #4 (permalink)  
Old 10-24-03, 03:20
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Rodney, I think you are correct. However, the problem is that plans/packages do get rebound for other reasons sometimes, and when that happens, there is potential for problems when select * is used in the view.

For example, a DBA might want to drop and recreate an index (which will force an automatic or explicit rebind of any plans/packages that use that index), or use rebind with explain yes to populate the explain tables, etc. So to guard against these rebinds, the program would need to be changed to add the new column, recompiled, and then do a bind replace (assuming that select * was in the view).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On