-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 a FETCH FIRST n ROWS ONLY clause was specified for outermost subselect.

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 a FETCH FIRST n ROWS ONLY clause was specified for outermost subselect, either change the cursor sensitivity or change the outermost subselect to remove the FETCH FIRST n ROWS ONLY clause.

SQLSTATE

36001