As indicated in the syntax diagram for DECLARE , not all SELECT statements can be associated with a read-only or update cursor.
If the DECLARE statement includes one of these options, you must observe certain restrictions on the SELECT statement that is included in the DECLARE statement (either directly or as a prepared statement).
If the DECLARE statement includes the FOR READ ONLY option, the SELECT statement cannot have a FOR READ ONLY or FOR UPDATE option. (For a description of SELECT syntax and usage, see SELECT.)
If the DECLARE statement includes the FOR UPDATE option, the SELECT statement must conform to the following restrictions: