-248   A POSITIONED DELETE OR UPDATE STATEMENT FOR CURSOR cursor-name SPECIFIED ROW n OF A ROWSET, BUT THE ROW IS NOT CONTAINED WITHIN THE CURRENT ROWSET

Explanation

The FOR ROW n OF ROWSET clause was specified on a positioned DELETE or UPDATE statement, but row n is not contained within the bound of the rowset. This situation can also occur when row n is within the bounds of the rowset that was requested, but the current rowset contains less than the requested number of rows. In this case, a partial rowset is returned. A partial rowset can occur for various reasons, including an end of data condition or an error that did not result in the closure of the cursor.

System action

The statement cannot be processed.

Programmer response

Reissue the positioned UPDATE or DELETE with a value that corresponds to a row of the current rowset. If the row that is specified is outside of the current rowset, then do the following:
  • Use the FOR n ROWS clause on a FETCH CURRENT ROWSET statement to specify that the rowset contains a larger number of rows
  • Reissue the positioned UPDATE or DELETE statement.
If this message is issued because a partial rowset was returned,
  • Update the application logic to detect that the actual rowset size was less than the rowset size that was requested
  • Ensure that a positioned UPDATE or DELETE statement only refers to rows of the current rowset.

SQLSTATE

24521