Oninit Logo
The Down System Specialists
+1-913-674-0360
+44-2081-337529
Partnerships Contact
Finderr

-365 Cursor must be defined on simple SELECT for FOR UPDATE.

The cursor named in this statement (probably an OPEN statement) was declared with the FOR UPDATE clause. However, it has been associated with a SELECT statement that joins two or more tables or that uses UNIQUE, DISTINCT, GROUP BY, ORDER BY, FOR READ ONLY, INTO TEMP, or UNION, INTERSECT, or MINUS. Such a SELECT statement cannot be used in an update, because there is no way to distribute the new data back into the multiple tables.

Review the declaration of the cursor. If it is declared FOR statement id, also review the PREPARE statement that set up that statement. You might need two cursors, one for general queries and another specifically for updating.