home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

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
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 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 FixList