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

DB2 MIGHT PRODUCE SQL0901N WHEN EXECUTING QUERY WITH GENERATED COLUMNS OF
DATATYPE DATE OR TIMESTAMP

product:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problem description:
Under rare scenario, DB2 might produce SQL0901N if the following 
conditions are true: 
 
1) There are two or more tables in the query 
2) There is a generated column defined in one of the tables 
3) The datatype of the generated column is DATE or TIMESTAMP 
4) There is no index on the generated column. 
5) The source of the generated column has an equality predicate 
6) The column from other side of the predicate has an index 
7) The query does not reference the generated column 
 
Example: 
CREATE TABLE T1( "DTCT_ID" TIMESTAMP NOT NULL WITH DEFAULT 
CURRENT TIMESTAMP); 
CREATE TABLE T2 ( "DTM_UTC" TIMESTAMP NOT NULL WITH DEFAULT  , 
"DT_UTC" DATE NOT NULL GENERATED ALWAYS AS (DATE(DTM_UTC)) ); 
 
CREATE UNIQUE INDEX IDX1 ON T1 ("DTCT_ID" ASC); 
 
SELECT DTCT_ID 
FROM T1, T2 
 
WHERE DTCT_ID = DTM_UTC; 
 
Below is the stack info : 
 
0        pthread_kill 
1        sqloDumpEDU 
2        sqldDumpContext 
3        sqlrr_dump_ffdc 
4        sqlzeDumpFFDC 
5        sqlzeSqlCode 
6        sqlnn_erds 
7        sqlng_process_parse_tree_node 
8        sqlng_process_BF_node 
9        sqlng_walk_BF_chain 
10       sqlng_build_thread 
 
SQL0901N  The SQL statement or command failed because of a 
database system 
error. (Reason "Bad Plan; Unresolved QNC found".) 
SQLSTATE=58004
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* ALL                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 Version 10.1 Fix Pack 5.                      * 
****************************************************************
Local Fix:
Solution
First fixed in DB2 Version 10.1 Fix Pack 5.
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
24.03.2014
23.07.2015
23.07.2015
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.1.0.5 FixList