Inserting into a non-nullable column with OLEDB2 results in SQLCODE: -407 error message

Article translations Article translations
Article ID: 330369
Note This also applies to Microsoft Host Integration Server 2000
Expand all | Collapse all

On This Page

Symptoms

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:
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
The SQLState and code indicates the following:
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.

Cause

The Microsoft Host Integration Server OLE DB provider for DB2 was incorrectly interpreting an empty string as a NULL.

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 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
   ----------------------------------------------------------
   24-Oct-2002  11:33  5.0.0.900    880,912  Mseidb2d.dll     
   24-Oct-2002  11:33  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.

Status

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.

Properties

Article ID: 330369 - Last Review: June 19, 2014 - Revision: 3.0
Keywords: 
kbqfe kbbug kbfix KB330369

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com