The specified table cannot be updated. The following possible reasons are possible:
2. The SQL statement contains a correlated subquery which uses the table to be updated.
3. The QUERY expression was specified with FOR UPDATE. However, the QUERY expression contains statement parts which cannot be used together with a FOR UPDATE specification (DISTINCT, GROUP CLAUSE, UNION, INTERSECT, EXCEPT, SUBQUERY).
4. In the DB2 SQL mode, the QUERY expression of an SQL statement with CURRENT OF <result_table_name> contains a FOR FETCH ONLY statement.
1. Replace the table name with that used in the FROM clause of the QUERY statement or repeat the QUERY statement using the required table name.
2. In the case of the correlated subquery, the desired effect can be achieved by generating a named result table which is then used in the subquery.
3. You must delete the FOR UPDATE or DISTINCT specification, or similar.
4. Repeat the QUERY expression, omitting FOR FETCH ONLY, or delete the CURRENT OF <result_table_name> specification from the SQL statement.