Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Unanswered: 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

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.

  3. #3
    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

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •