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

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

product:
DB2 FOR LUW / DB2FORLUW / 970 - 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 970 fixpack 8                  * 
****************************************************************
Local Fix:
Manually rewrite the query to perform De Morgan's Law
available fix packs:
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
First fixed in DB2 version 970 fixpack 8
Workaround
not known / see Local fix
BUG-Tracking
forerunner  : APAR is sysrouted TO one or more of the following: IC89439 
follow-up : 
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
01.11.2012
01.04.2013
01.04.2013
Problem solved at the following versions (IBM BugInfos)
9.7.0
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.8 FixList