DB2 - Problem description
Problem IC84490 | 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 / A10 - 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 * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 version 10.1 Fix Pack 1. * **************************************************************** | |
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 10.1 Fix Pack 1 for Linux, UNIX, and Windows | |
Solution | |
The problem is first fixed in DB2 version 10.1 Fix Pack 1 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 14.06.2012 01.11.2012 01.11.2012 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.1.0.1 | |
10.5.0.1 |