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

QUERY MIGHT FAIL WITH SQL0901N - BAD PLAN, UNRESOLVED QNC FOUND

product:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problem description:
Under rare scenarios, DB2 might return a SQL0901N error message 
if the following conditions are satisfied: 
Scenario 1: 
1. Query has an OR predicate 
2. One of the subterms contains a complex expression with a 
negation. 
eg. NOT CAST (cast('abcd' as CHAR(188)) AS CHARACTER (188)) >= 
TRANSLATE(CAST (cast('xyz' as CHAR(87)) AS CHAR (87))) 
 
Scenario 2: 
1. The query has a case expression as one of the output columns 
2. The case expression contains a complex expression with a 
negation. 
eg. 
SELECT 
CASE 
WHEN NOT CAST (cast('abcd' as CHAR(188)) AS CHARACTER (188)) >= 
SUBSTR (CAST (cast('xyz' as CHAR(87)) AS CHAR (87)), 82, 1) 
THEN c1 
ELSE c1 end 
from t1; 
 
Error Message: 
SQL0901N: Bad Plan; Unresolved QNC found 
 
 
Stack: 
sqlng_process_parse_tree_node 
sqlng_process_BF_node 
sqlng_process_parse_tree_node 
sqlng_process_BF_node 
sqlng_process_parse_tree_node 
sqlng_process_BF_node 
sqlng_walk_BF_chain 
sqlng_build_thread 
sqlng_build_TA_op 
sqlng_process_f_iscan 
sqlng_process_fetch_op
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Please upgrade to DB2 version 101 fix pack 3                 * 
****************************************************************
Local Fix:
Manually rewrite the query to perform De Morgan's Law
available fix packs:
DB2 Version 10.1 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 6 for Linux, UNIX, and Windows

Solution
Fix was included in DB2 version 101 fix pack 3
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
09.01.2013
07.10.2013
07.10.2013
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.1.0.3 FixList
10.1.0.3 FixList