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

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

product:
DB2 FOR LUW / DB2FORLUW / 970 - 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:                                              * 
* CLPPlus on all platforms                                     * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 Version 9.7 Fix Pack 9.                       * 
****************************************************************
Local Fix:
available fix packs:
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
First fixed in Version 9.7 Fix Pack 9.
Workaround
not known / see Local fix
BUG-Tracking
forerunner  : APAR is sysrouted TO one or more of the following: IC97838 IC97852 
follow-up : 
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
07.11.2013
16.12.2013
16.12.2013
Problem solved at the following versions (IBM BugInfos)
9.7.FP9
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.9 FixList
9.7.0.9 FixList