DB2 - Problem description
Problem IT35891 | Status: Closed |
WRONG RESULT MIGHT BE RETURNED WHEN SUBSTR WITH IF ELSE CLAUSES WAS USED AND THE COLUMN WAS CREATED IN CODEUNIT32 | |
product: | |
DB2 FOR LUW / DB2FORLUW / B50 - DB2 | |
Problem description: | |
Wrong result might be returned if substr with IF ELSE clauses was used . The column also need to be created in Codeunit32 create table t1(lob char(3 codeunits32)) organize by column insert into t1 values(' 6'); select case when SUBSTR(lob,3,1)='6' then 'A' else 'B' end from t1. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * all * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to 11.5.6 or later * **************************************************************** | |
Local Fix: | |
SUBSTRING could be used to return the correct result; https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.5.0/com .ibm.db2.luw.sql.ref.doc/doc/r0023196.html select case when SUBSTRING(lob,CASE WHEN LOB IS NULL THEN NULL ELSE 3 END,1)='6' then 'RV' else 'AU' end from t1 | |
Solution | |
Workaround | |
**************************************************************** * USERS AFFECTED: * * all * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to 11.5.6 or later * **************************************************************** | |
Comment | |
Upgrade to 11.5.6 or later | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 12.02.2021 21.06.2021 23.06.2021 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |