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 IC97838 Status: Closed

CLPPLUS DISPLAYS INCORRECT RESULT WHEN MORE THAN ONE LIKE CLAUSE IS
SPECIFIED IN A SELECT STATEMENT

product:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problem description:
CLPPLus displays different result sets only when I change the 
predicate order within the where clause for character columns 
selected with LIKE '%1' or LIKE '%2'. 
 
SQL> create table test1 ( i int , text varchar(10) ) ; 
 
DB250000I: Der Befehl wurde erfolgreich ausgefチhrt. 
 
SQL> insert into test1 values (1, 'Text1'), (2, 'Text2') ; 
 
DB250000I: Der Befehl wurde erfolgreich ausgefチhrt. 
 
SQL> select * from test1 where i = 1 or i = 2 ; 
 
          I TEXT 
----------- ---------- 
          1 Text1 
          2 Text2                              CORRECT RESULT 
ROWS! 
 
SQL> select * from test1 where text like '%1' or text like '%2' 
; 
 
          I TEXT 
----------- ----------                         INCORRECT 
RESULTSET!!! 
         1 Text1                                   => ONLY Row 
(1, ?Text1?) is returned and not (2, ?Text2?) -> Must also 
displayed in the result set 
 
SQL> select * from test1 where text like '%2' or text like '%1' 
; 
 
          I TEXT 
----------- ----------                         INCORRECT 
RESULTSET!!! 
          2 Text2                                   => ONLY Row 
(2, ?Text2?) is returned and not (1, ?Text1?) -> Must also 
displayed in the result set 
 
 
 
 
When the same SQLs are issued on the command line or Data Studio 
the results are correct! 
 
db2blu01@vmdb202:~> db2 "select * from test1 where i = 1 or i = 
2 " 
 
I           TEXT 
----------- ---------- 
          1 Text1 
          2 Text2 
 
  2 record(s) selected. 
 
db2blu01@vmdb202:~> db2 "select * from test1 where text like 
'%1' or text like '%2' " 
 
I           TEXT 
----------- ---------- 
          1 Text1 
          2 Text2 
 
  2 record(s) selected. 
 
db2blu01@vmdb202:~> db2 "select * from test1 where text like 
'%2' or text like '%1' " 
 
I           TEXT 
----------- ---------- 
          1 Text1 
          2 Text2 
 
  2 record(s) selected.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* Users using CLPPlus.                                         * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 Version 10.1 Fix Pack 4.                      * 
****************************************************************
Local Fix:
available fix packs:
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 6 for Linux, UNIX, and Windows

Solution
First fixed in DB2 Version 10.1 Fix Pack 4.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
21.11.2013
02.06.2014
02.06.2014
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.1.0.4 FixList