IBM Support

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

  • Users Affected: OLEDB applications that query data from
    DB2/iSeries
    
    Problem Description: Problem only occurs if the Application
    queries both PACKED and ZONED DECIMAL columns at the same time.
    
    Problem Summary: same as above
    

Problem conclusion

  • Problem first fixed in FP14
    

Temporary fix

Comments

APAR Information

  • APAR number

    JR24776

  • Reported component name

    DB2 CUE WINDOWS

  • Reported component ID

    5724B6201

  • Reported release

    820

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2006-09-11

  • Closed date

    2006-11-28

  • Last modified date

    2006-11-28

  • 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 CUE WINDOWS

  • Fixed component ID

    5724B6201

Applicable component levels

  • R820 PSY

       UP

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"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":"820"}]

Document Information

Modified date:
06 October 2021