Declare CursorName insensitive ...

ASENSITIVE, SENSITIVE,
or INSENSITIVE Specifies whether the cursor is asensitive, sensitive, or insensitive to changes. ASENSITIVE Specifies that the cursor may behave as SENSITIVE or INSENSITIVE depending on how the select-statement is optimized. This is the default. SENSITIVE Specifies that changes made to the database after the cursor is opened are visible in the result table. The cursor has some level of sensitivity to any updates or deletes made to the rows underlying its result table after the cursor is opened. The cursor is always sensitive to positioned updates or deletes using the same cursor. Additionally, the cursor can have sensitivity to changes made outside this cursor. If the database manager cannot make changes visible to the cursor, then an error is returned. The database manager cannot make changes visible to the cursor when the cursor implicitly becomes read-only. (See "Result table of a cursor" on page 744.) INSENSITIVE Specifies that once the cursor is opened, it does not have sensitivity to inserts, updates, or deletes performed by this or any other activation group. If INSENSITIVE is specified, the cursor is read-only and a temporary result is created when the cursor is opened. In addition, the SELECT statement cannot contain a FOR UPDATE clause and the application must allow a copy of the data (ALWCPYDTA(*OPTIMIZE) or ALWCPYDTA(*YES)).