Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: You receive an "unexpected data length" error message when you run a query and you are using Host Integration Server OLE DB Provider for DB2


View products that this article applies to.

Symptoms

When you are using Microsoft Host Integration Server 2004 OLE DB Provider for DB2 or Host Integration Server 2000 OLE DB Provider for DB2, you may receive an error message that is similar to the following when you run a query:
OLE DB provider 'DB2OLEDB' returned an unexpected data length for the fixed-length column '[DB2OLEDB].TESTDATA'. The expected data length is 8, while the returned data length is 0. OLE DB error trace [Non-interface error: Unexpected data length returned for the column: ProviderName='DB2OLEDB', TableName='[DB2OLEDB]', ColumnName='TESTDATA', ExpectedLength='8', ReturnedLength='0'].

↑ Back to the top


Cause

When a query returns a fixed-length character column, such as CHAR(4), the data provider expects to receive non null data for each byte of data. This problem occurs because a null character (hexadecimal 00) is embedded in the data.

↑ Back to the top


Resolution

Host Integration Server 2004

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version     Size     File name
   ----------------------------------------------------------------------------------
   26-Jul-2005  16:11  6.0.1972.0  487,424  Db2oledb.dll
   26-Jul-2005  16:16               24,516  Db2oledb.h
   26-Jul-2005  16:11  6.0.1972.0   44,032  Ddmstr.dll
   26-Jul-2005  16:11  6.0.1972.0  114,688  Microsoft.hostintegration.msdb2client.dll
   26-Jul-2005  16:11  6.0.1972.0   71,680  Mseidb2c.dll
   26-Jul-2005  16:11  6.0.1972.0  435,200  Mseidb2d.dll
   26-Jul-2005  16:11  6.0.1972.0  693,760  Mseidrda.dll
Note Because of file dependencies, the most recent hotfix that contains these files may contain additional files.

Host Integration Server 2000

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version     Size     File name
   -----------------------------------------------------
   25-Aug-2005  08:53  5.0.0.2077  311,568  Crtpkg.dll
   25-Aug-2005  08:53  5.0.0.2077   61,712  Crtpkg.exe
   25-Aug-2005  08:53  5.0.0.2077  696,592  Db2oledb.dll
   25-Aug-2005  08:53  5.0.0.2077   69,904  Mseidb2c.dll
   25-Aug-2005  08:53  5.0.0.2077  889,104  Mseidb2d.dll
   25-Aug-2005  08:53  5.0.0.2077  270,608  Mseidrda.dll
Note Because of file dependencies, the most recent hotfix that contains these files may contain additional files.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More information

The hotfix removes embedded null values in the data. Additionally, this hotfix appends spaces on the end of the string to make the string the same length as the fixed-length column.

Steps to reproduce the problem

  1. In IBM DB2, create a table that contains a fixed-length column and insert null characters in the column. To do this, run the following command:
    CREATE TABLE NULLSPACE (COL1 CHAR(4)) INSERT INTO NULLSPACE VALUES (x'00000000')
  2. In Microsoft SQL Server, define a linked server that uses the OLE DB Provider for DB2.
  3. In SQL Query Analyzer, run the following query.
    SELECT * FROM OPENQUERY(LINKSRVR, 'SELECT * FROM NULLSPACE')
    You receive the error message that is mentioned in the "Symptoms" section.
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684� Description of the standard terminology that is used to describe Microsoft software updates
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

↑ Back to the top


Keywords: KB903116, kbpubtypekc, kbbug, kbfix, kbqfe, kbhotfixserver, kbautohotfix

↑ Back to the top

Article Info
Article ID : 903116
Revision : 7
Created on : 12/4/2007
Published on : 12/4/2007
Exists online : False
Views : 395