-227   FETCH fetch-orientation IS NOT ALLOWED, BECAUSE CURSOR cursor-name HAS AN UNKNOWN POSITION (sqlcode,sqlstate)

Explanation

The cursor position for cursor-name is unknown. The previous multiple-row FETCH for cursor cursor-name resulted in an error (SQLCODE sqlcode, SQLSTATE sqlstate) in the middle of processing multiple rows that were retrieved from DB2®. One or more of the requested rows could not be returned to the program following the error, leaving the position of the cursor unknown.

If an indicator structure had been provided on the previous multiple-row FETCH, a positive SQLCODE would have been returned and all of the rows that were retrieved from DB2 could have been returned to the application program.

System action

The statement cannot be processed. The cursor position is not changed.

Programmer response

Close and reopen the cursor to reset the position. For scrollable cursors, you can change the FETCH statement to specify one of the other fetch orientations (such as FIRST, LAST, BEFORE, AFTER, or ABSOLUTE) to establish a valid cursor position and fetch a row of data.

SQLSTATE

24513