Start of change

-243 SENSITIVE CURSOR cursor-name CANNOT BE DEFINED FOR THE SPECIFIED SELECT STATEMENT

Explanation

A clause was not valid for one of the following reasons:
  • The cursor, cursor-name, is defined as SENSITIVE, but the content of the SELECT statement makes the cursor read-only. In most cases the SELECT statement requires Db2 to build a temporary table or work file with the result table of the cursor, and Db2 cannot guarantee that changes made outside the cursor will be visible. In this case, the cursor must be defined INSENSITIVE or ASENSITIVE.
  • The cursor, cursor-name, is defined as SENSITIVE DYNAMIC and an OFFSET or FETCH clause was specified for outermost subselect or fullselect.

System action

The statement cannot be processed.

Programmer response

If the cursor is defined as SENSITIVE, but the content of the SELECT statement makes the cursor read-only, either change the content of the query to result in a result table that is not read-only, or change the type of cursor to be INSENSITIVE or ASENSITIVE.

If the cursor is defined as SENSITIVE DYNAMIC and an OFFSET clause or FETCH clause was specified for outermost subselect or fullselect, either change the cursor sensitivity or change the outermost subselect or fullselect to remove the OFFSET clause or FETCH clause.

SQLSTATE

36001

End of change