Article ID: 330369 - View products that this article applies to.
This article was previously published under Q330369
Note This also applies to Microsoft Host Integration Server 2000
While using the Microsoft Host Integration Server OLE DB provider for DB2, if you insert on an empty string into a column that is non-nullable, you may receive the following error message:
The SQLState and code indicates the following:
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: 23502, SQLCODE: -407
Cause: The column is a target column in an UPDATE, INSERT, or ALTER TABLE statement. If this is an ALTER TABLE statement, a null value exists in a relative entry of the column for which you are attempting to disallow nulls. Otherwise, a null value was specified to be inserted or updated into this column, but the column does not allow null values. If this is an INSERT statement, then the null value was specified in a relative entry in the VALUES list or the select list. If this is an UPDATE statement, then the null value was specified in a relative entry in the SET clause. The null value was specified as either NULL, a host variable with an associated indicator variable that contains a negative value, a column containing a null value, or an expression that evaluated to NULL.
Recovery: If this is an ALTER TABLE statement, change the existing null values in the column to a non-null value. If this is an INSERT or UPDATE statement, change the value so the result is not null. If a host variable is specified, change the value in the related indicator variable to be greater than or equal to zero. Try the request again. The SQLCODE is -407 and the associated message is SQL0407.
The Microsoft Host Integration Server OLE DB provider for DB2 was incorrectly interpreting an empty string as a NULL.
Service pack informationTo 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:
(http://support.microsoft.com/kb/328152/ )How to obtain the latest service pack for Host Integration Server 2000
Hotfix informationThe 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.
Note Because of file dependencies, the most recent fix that contains the preceding files may also contain additional files.
Date Time Version Size File name ---------------------------------------------------------- 24-Oct-2002 11:33 18.104.22.1680 880,912 Mseidb2d.dll 24-Oct-2002 11:33 22.214.171.1240 262,416 Mseidrda.dll
Microsoft has confirmed that this is a problem in Microsoft Host Integration Server 2000 and Microsoft Host Integration Server 2000 Service Pack 1.
This problem was corrected in Microsoft Host Integration Server 2000 Service Pack 2.
Contact us for more help
Connect with Answer Desk for expert help.