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.

Calling Stored Procedure From ADO.NET Results in SQLCODE: -188


View products that this article applies to.

This article was previously published under Q330096

↑ Back to the top


Symptoms

Note: This article also applies to Microsoft Host Integration Server 2000 Service Pack 1 (SP1).

Calling a Stored Procedure from ADO.NET using the Microsoft OLE DB Provider for DB2 results in the following error:
A SQL error has occurred. Please consult the documentation for your specific DB2 version for a description of the associated Native Error and SQL State. SQLSTATE: 22503, SQLCODE: -188

↑ Back to the top


Cause

The OLE DB Provider for DB2 does not correctly parse the command used to call a Stored Procedure that is received from ADO.NET.

↑ Back to the top


Resolution

Service pack information

To resolve this problem, obtain the latest service pack for Microsoft Host Integration Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
328152� How to obtain the latest service pack for Host Integration Server 2000

Hotfix information

The English version of this fix has the file attributes (or later) 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
   --------------------------------------------------
   17-Oct-2002  17:58  5.0.0.900   880,912  Mseidb2d.dll     
   17-Oct-2002  17:58  5.0.0.900   262,416  Mseidrda.dll     
				

NOTE: Because of file dependencies, the most recent fix that contains the preceding files may also contain additional files.

↑ Back to the top


Workaround

The problem does not occur if the call to the Stored Procedure is passed as command text. The following C# code excerpt can be used as an example:
OleDbCommand myCommand = new OleDbCommand("CALL <stored procedure name>(?)", myConnection);
myCommand.CommandType = CommandType.Text;
				

↑ 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.

This problem was corrected in Microsoft Host Integration Server 2000 Service Pack 2.

↑ Back to the top


More information

ADO.NET sends a command in the following format to the OLE DB Provider when calling a Stored Procedure:
EXEC <stored procedure name> ?
				
Previous versions of ADO send the same command in the following format when calling a Stored Procedure:
EXEC <stored procedure name>
				
The SQL parser in the Microsoft OLE DB Provider for DB2 had to be updated to correctly parse the ? included in the ADO.NET format of the command.

↑ Back to the top


Keywords: KB330096, kbhotfixserver, kbqfe, kbfix, kbbug

↑ Back to the top

Article Info
Article ID : 330096
Revision : 3
Created on : 9/27/2005
Published on : 9/27/2005
Exists online : False
Views : 391