DB2 - Problem description
Problem IC79029 | Status: Closed |
INCORRECT RESULTS OR SQL0901 RETURNED WHEN FOR BIT DATA ARGUMENT USED BY LIKE, LOCATE, POSSTR, OR POSITION WITHIN A SQL UDF | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
Under some collating sequences, a query can return incorrect results or a SQL0901 error code when a FOR BIT DATA argument is passed to a SQL user-defined function expecting mixed data input parameters and that parameter is used by a LIKE, LOCATE, LOCATE_IN_STRING, INSTR, POSSTR or POSITION built-in function. The following example should return 'T' but will return 'F' if you are using an affected collation prior to the fixpak containing the fix. CREATE FUNCTION F(x varchar(10)) RETURNS varchar(1) deterministic no external action reads sql data return case when x like '%def' then 'T' else 'F' end; VALUES F( cast( 'abcdef' as varchar(10) for bit data ) ); | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * . * **************************************************************** * RECOMMENDATION: * * Apply version 9.7 Fix Pack 5 on the database server. * **************************************************************** | |
Local Fix: | |
Cast the function input to MIXED DATA prior to passing it as input to the SQL UDF or change the UDF definition to expect BIT DATA columns. | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows | |
Solution | |
Problem was first fixed in Version 9.7 Fix Pack 5. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 03.10.2011 19.12.2011 19.12.2011 |
Problem solved at the following versions (IBM BugInfos) | |
9.7.FP5 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.5 |