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 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
DB2 Version 9.7 Fix Pack 2 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 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 FixList