DB2 - Problem description
Problem IT26178 | Status: Closed |
WRONG RESULTS FROM SELECT INTO STATEMENT CONTAINING WITH CLAUSE AND DATA-CHANGE-TABLE-REFERENCE | |
product: | |
DB2 FOR LUW / DB2FORLUW / B10 - DB2 | |
Problem description: | |
A SELECT INTO statement with multiple assignment targets may assign the results in the wrong order. This can happen when the SELECT INTO statement has all the following characteristics: - two or more common-table-expressions - at least one of the common-table-expressions includes a data-change-table-reference - multiple assignment-targets The symptom depends on whether the assignment-targets are compatible with the re-ordered select list. If there is an incompatibility, an error is returned at execution time. e.g.: create table t1 (i int); CREATE OR REPLACE PROCEDURE P ( out i int, out t time ) LANGUAGE SQL BEGIN WITH CTE1(I) AS ( SELECT * from final table( insert into T1 values (1)) ), CTE2(T) as (values current time) SELECT CTE1.I, CTE2.T INTO I, T FROM CTE1,CTE2; -- END DB20000I The SQL command completed successfully. call p(?,?) SQL0303N A value cannot be assigned to a host variable in the SELECT, VALUES, FETCH or assignment statement because the data types are not compatible. SQLSTATE=42806 Otherwise, if no conversion error occurs, assignment-targets will have the wrong values. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 11.1 Mod 4 Fixpack 4 or higher * **************************************************************** | |
Local Fix: | |
Solution | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 04.09.2018 27.11.2018 27.11.2018 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |