IBM Support

IC79500: THE 'DESCRIBE TABLE' OUTPUT FOR A VIEW MAY SHOW INCORRECT NUMBER OF COLUMNS EVEN AFTER THE VIEW IS REVALIDATED.

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • If the view is defined as "select * from <table>" and has been
    invalidated due to a column dropped from the base table, the
    'DESCRIBE TABLE' command on the view will return incorrect
    result even after the view gets revalidated. This is caused by
    an inconsistency in the system catalog, specifically
    syscat.columns, where the record for the dropped column is not
    removed.
    
    However, this does not impact the result set return from the
    view and 'DESCRIBE select * from view' shows the correct result.
    
    Example:
    
    create table T1 ( c1 integer, c2 integer, c3 integer )
    DB20000I  The SQL command completed successfully.
    
    create view V1 as select * from T1
    DB20000I  The SQL command completed successfully.
    
    alter table T1 drop column c3
    DB20000I  The SQL command completed successfully.
    
    select * from V1      (revalidates the view)
    
    C1          C2
    ----------- -----------
    
      0 record(s) selected.
    
    describe select * from V1
    
     Column Information
    
     Number of columns: 2
    
     SQL type              Type length  Column name
    Name length
     --------------------  -----------
    ------------------------------  -----------
     497   INTEGER                   4  C1
    2
     497   INTEGER                   4  C2
    2
    
    describe table V1
    
                                    Data type
    Column
    Column name                     schema    Data type name Length
    Scale Nulls
    ------------------------------- --------- -------------------
    ---------- ----- ------
    C1                                   SYSIBM    INTEGER
    4             0     Yes
    C2                                   SYSIBM    INTEGER
    4             0     Yes
    C3                                   SYSIBM    INTEGER
    4             0     Yes
    
      3 record(s) selected.
    

Local fix

  • Recreate the view using 'CREATE OR REPLACE VIEW'
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * THE 'DESCRIBE TABLE' OUTPUT FOR A VIEW MAY SHOW INCORRECT    *
    * NUMBER                                                       *
    * OF COLUMNS EVEN AFTER THE VIEW IS REVALIDATED.               *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * upgrade to DB2 Fix Pack 6                                    *
    ****************************************************************
    

Problem conclusion

  • First Fixed in DB2 V9.7 Fix Pack 6
    

Temporary fix

  • Recreate the view using 'CREATE OR REPLACE VIEW'
    

Comments

APAR Information

  • APAR number

    IC79500

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-10-27

  • Closed date

    2012-06-06

  • Last modified date

    2012-06-06

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP

  • R970 PSY

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC79500

Modified date: 06 June 2012