IBM Support

JR24777: SQL SERVER cannot handle both PACKED DECIMAL and ZONED DECIMAL when using the IBM OLE DB Provider

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The CLI function - SQLColumns, and the IBM OLE DB Provider
    function - IDBSchemaRowset, report PACKED DECIMAL fields as
    DECIMAL and ZONED DECIMAL FIELDS as NUMERIC. This is as
    designed. However, IColumnsInfo reports both as Decimal. This is
    because it calls SQLDescribe internally, which returns
    SQL_DECIMAL for both data types.
    
    The problem comes when SQL Server - using the IBM OLE DB
    Provider - fetches data from another data source. It cross
    checks the data types from IColumnsInfo and IDBSchemaRowset. If
    they don't match, it reports an error like:
      OLE DB provider 'IBMDADB2' supplied inconsistent metadata for
      a column.
      Metadata information was changed at execution time.
      OLE DB error trace [Non-interface error: Column 'COL_A'
      (compile-time ordinal 1) of object '"DBNAME.SCHEMA.TABLE"' was
      reported to have a DBTYPE of 131 at compile time and 14 at run
      time].
    
    By default, the PACKED DECIMAL columns are fine, but the ZONED
    DECIMAL columns generate the above error.
    
    You can use the MapDecimalToNumeric=1 parameter on the
    connection string. This will stop ZONED DECIMAL columns from
    generating an error, but PACKED DECIMAL columns will now report
    a similar error - DBTYPE of 14 at compile time and 131 at run
    time.
    

Local fix

  • Local Fix: None
    
    Work Around: Create a VIEW on DB2 for iSeries that CASTs the
    ZONED DECIMAL to PACKED DECIMAL and select from this VIEW
    instead.
    

Problem summary

  • ERROR DESCRIPTION:
    The CLI function - SQLColumns, and the IBM OLE DB Provider
    function - IDBSchemaRowset, report PACKED DECIMAL fields as
    DECIMAL and ZONED DECIMAL FIELDS as NUMERIC. This is as
    designed. However, IColumnsInfo reports both as Decimal. This is
    because it calls SQLDescribe internally, which returns
    SQL_DECIMAL for both data types.
    
    The problem comes when SQL Server - using the IBM OLE DB
    Provider - fetches data from another data source. It cross
    checks the data types from IColumnsInfo and IDBSchemaRowset. If
    they don't match, it reports an error like:
      OLE DB provider 'IBMDADB2' supplied inconsistent metadata for
      a column.
      Metadata information was changed at execution time.
      OLE DB error trace [Non-interface error: Column 'COL_A'
      (compile-time ordinal 1) of object '"DBNAME.SCHEMA.TABLE"' was
      reported to have a DBTYPE of 131 at compile time and 14 at run
      time].
    
    By default, the PACKED DECIMAL columns are fine, but the ZONED
    DECIMAL columns generate the above error.
    
    You can use the MapDecimalToNumeric=1 parameter on the
    connection string. This will stop ZONED DECIMAL columns from
    generating an error, but PACKED DECIMAL columns will now report
    a similar error - DBTYPE of 14 at compile time and 131 at run
    time.
    

Problem conclusion

  • Problem first fixed in DB2 v9 FP3 (s070719)
    

Temporary fix

  • Local Fix:
    Local Fix: None
    

Comments

APAR Information

  • APAR number

    JR24777

  • Reported component name

    DB2 CUE WINDOWS

  • Reported component ID

    5724B6201

  • Reported release

    910

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2006-09-11

  • Closed date

    2007-08-20

  • Last modified date

    2007-08-20

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

    JR24776

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

Fix information

  • Fixed component name

    DB2 CUE WINDOWS

  • Fixed component ID

    5724B6201

Applicable component levels

  • R910 PSY

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"910","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
07 January 2022