DB2 - Problem description
Problem IC97005 | Status: Closed |
CAST() IN QUERY USED IN .NET FRAMEWORK DOES NOT ADEQUATELY RESOLVE PRECISION OF DATETIME DATATYPE IN IDS DATABASE. | |
product: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
Problem description: | |
When using 'CAST() as' clause in a query, .NET Framework is unable to accurate gauge the precision of the DateTIme data type. Instead, it uses the maximum precision for the data type (Year to fraction(5)). This becomes a problem when the cast is part of SELECT ... UNION... statement, and the precision of the cast does not match the precision of a column type. In that scenario, the following error results: <m:internalexception><m:message>ERROR [IX000] [IBM][IDS/UNIX64] Corresponding column types must be compatible for each UNION statement. <---------------- </m:message><m:type>IBM.Data.DB2. DB2Exception</m:type><m:stack trace> at IBM.Data.DB2.DB2Command.ExecuteReaderObject(Command Behavior behavior, String method, DB2CursorType reqCursorType, Boolean abortOnOptValueChg, Boolean skipDeleted, Boolean isResultSet, Int32 maxRows, Boolean skipInitialValidation) at IBM.Data.DB2.DB2Command.ExecuteReaderObject(Comman dBehavior behavior, String method) at IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavi or behavior) at IBM.Data.DB2.DB2Command.ExecuteDbDataReader(Command Behavior behavior) at System.Data.EntityClient.EntityCommandDefinition.E xecuteStoreCommands(En tityCommand entityCommand, CommandBehavior behavior)</m:stacktrace></m:internalexception> Operating system and level Windows Client, server, and gateway information Client connects to server, no gateway involved. Server information, if applicable Will get an update defect. How to reproduce the problem Yunming Wang reports reproducing the problem with the test case from defect wsdbu00956011. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Informix DRDA users * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 data server package v10.5 fp3 * **************************************************************** | |
Local Fix: | |
Either restructure the query so a UNION is not used, which makes the problem moot, or modify DateTime columns to maximum precision of Year to Fraction(5) so the problem is not visible. | |
available fix packs: | |
DB2 Version 10.5 Fix Pack 3 for Linux, UNIX, and Windows | |
Solution | |
This defect is first fixed in DB2 client v10.5 fp3 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 18.10.2013 09.12.2013 09.12.2013 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.5.0.3 | |
10.5.0.3 |