DB2 - Problem description
| Problem IC95100 | Status: Closed |
BLOB AND CLOB DATATYPES ARE NOT CAST CORRECTLY IN .NET ENTITY FRAMEWORK GENERATED QUERIES WHEN USING INFORMIX DATABASES | |
| product: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
| Problem description: | |
You have created a .NET Entity Framework project that retrieves
some data from an Informix IDS database and involves tables
having columns of type CLOB or BLOB. In some cases the data
retrieval operation fails with an exception similar to
IBM.Data.DB2.DB2Exception (0x80004005): ERROR [IX000]
[IBM][IDS/NT64] Corresponding column types must be compatible
for each UNION statement.
at IBM.Data.DB2.DB2Command.ExecuteReaderObject
at IBM.Data.DB2.DB2Command.ExecuteReaderObject
at IBM.Data.DB2.DB2Command.ExecuteReader
at IBM.Data.DB2.DB2Command.ExecuteDbDataReader
at System.Data.Common.DbCommand.ExecuteReader
at
System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCom
mands
as a consequence of an error -308 returned by IDS. This error is
returned in a range of situations and in the case of this APAR
it is caused by a cast operation problem where, in some parts of
a query involving UNIONs, CLOB is cast as VARCHAR(255) or BLOB
is cast to BYTE as shown in the following SQL fragment:
(...)
SELECT
Extent1.id AS id,
Extent1.image AS image, -- this is a
BLOB column
CAST(NULL AS varchar(255)) AS C2, -- ERR: should
be cast as CLOB
FROM "informix".myelements_blob AS Extent1
UNION ALL
SELECT
Extent2.id AS id,
CAST(NULL AS byte) AS C2, --ERR: should be
cast as BLOB
Extent2.novel AS novel, -- this is a CLOB
column
FROM "informix".myelements_clob AS Extent2
(...) | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 10.5 Fix Pack 4. * **************************************************************** | |
| Local Fix: | |
| available fix packs: | |
DB2 Cancun Release 10.5.0.4 (also known as Fix Pack 4) for Linux, UNIX, and Windows | |
| Solution | |
First fixed in DB2 Version 10.5 Fix Pack 4. | |
| Workaround | |
not known / see Local fix | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 21.08.2013 09.09.2014 09.09.2014 |
| Problem solved at the following versions (IBM BugInfos) | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 10.5.0.4 |
|