Microsoft KB Archive/903116

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

Article ID: 903116

Article Last Modified on 12/4/2007

-

APPLIES TO


 * Microsoft Host Integration Server 2004 Standard Edition
 * Microsoft Host Integration Server 2000 Standard Edition

-





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'].



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.



Hotfix information
A supported hotfix is now 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 service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or 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. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

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.

Hotfix information
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Host Integration Server 2000 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

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.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



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
 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')

 In Microsoft SQL Server, define a linked server that uses the OLE DB Provider for DB2.  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 &quot;Symptoms&quot; 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.

Additional query words: DB2OLEDB HIS2000 HIS2004

Keywords: kbbug kbfix kbqfe kbpubtypekc kbhotfixserver KB903116

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.