DB2 - Problem description
Problem IC64585 | Status: Closed |
SQL SCALAR FUNCTION IN SELECT-CLAUSE BLOCKS USE OF UPDATE-CLAUSE WITH SQLSTATE 42829 | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
The following query should be valid: select T1.C1, MYSQLUDF( T1.C2 ) A from T1 for update where MYSQLUDF is a SQL scalar function. The expected result is that the update-clause implicitly includes all updatable columns of table T1. However, the query fails to compile with the following error: SQL0511N The FOR UPDATE clause is not allowed because the table specified by the cursor cannot be modified. SQLSTATE=42829 | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * The following query should be valid: * * * * * * * * select T1.C1, MYSQLUDF( T1.C2 ) A from T1 for update * * * * * * * * where MYSQLUDF is a SQL scalar function. The expected * * result is * * that the update-clause implicitly includes all updatable * * columns * * of table T1. However, the query fails to compile with the * * * * following error: * * * * * * * * SQL0511N The FOR UPDATE clause is not allowed because the * * table * * specified by the cursor cannot be modified. SQLSTATE=42829 * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 version 9.1 fix pack 1. * * * * Alternatively, explicitly specify the updatable columns in * * the update-clause. For example, using the query above: * * * * * * * * select T1.C1, MYSQLUDF( T1.C2 ) A from T1 for update of * * C1, C2; * **************************************************************** | |
Local Fix: | |
Explicitly specify the updatable columns in the update-clause. For example, using the query above: select T1.C1, MYSQLUDF( T1.C2 ) A from T1 for update of C1, C2; | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 1 for Linux, UNIX, and Windows | |
Solution | |
Fixed in DB2 version 9.1 fix pack 1 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 17.11.2009 17.02.2010 17.02.2010 |
Problem solved at the following versions (IBM BugInfos) | |
9.1.FP1 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.1 |