DB2 - Problem description
Problem IC81393 | Status: Closed |
INCORRECT RESULT IF A NEW TABLE DATA-CHANGE-TABLE-REFERENCE OF A SIMPLE VIEW WITH A GENERATED ALWAYS AS EXPRESSION COLUM | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
Certain queries may return in correct results when they contain a NEW TABLE data-change-reference for an INSERT or UPDATE of a simple view. The view exposes a GENERATED ALWAYS AS EXPRESSION column from the base table and does not have any predicates In this case the value returned by the query for the GENERATED ALWAYS AS EXPRESSION column may be incorrect. The data stored in the table for the GENERATED ALWAYS AS EXPRESSION column is correct, and can be retrieved via a normal select column. An example is below CREATE TABLE T1 (X INT, Y INT, Z INT GENERATED ALWAYS AS (X+Y)); CREATE VIEW V1 AS SELECT * FROM T1; SELECT * FROM NEW TABLE (UPDATE V1 SET X = X+1); The value returned f from the query for column Z may be incorrect. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * All users on DB2 v97 FP5 and earlier * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 v97 FP6 * **************************************************************** | |
Local Fix: | |
1) Split the query into two parts, first to INSERT or UPDATE the data and a second to get the new values. 2) Add a simple predicate to the view definition. | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows | |
Solution | |
First Fixed in DB2 v97 FP6 | |
Workaround | |
not known / see Local fix | |
BUG-Tracking | |
forerunner : APAR is sysrouted TO one or more of the following: IC84490 follow-up : | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 13.02.2012 21.08.2012 21.08.2012 |
Problem solved at the following versions (IBM BugInfos) | |
9.7.FP6 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.6 |