-225 FETCH STATEMENT FOR cursor-name IS NOT VALID FOR THE DECLARATION OF THE CURSOR
Explanation
DB2® could
not process a FETCH statement for cursor cursor-name because
it contained a disallowed keyword. One of the following errors have
occurred:
- A FETCH statement for a non-scrollable cursor specified one of the keywords PRIOR, FIRST, LAST, ABSOLUTE, RELATIVE, CURRENT, BEFORE, or AFTER. These keywords are disallowed for a cursor that was not declared with the SCROLL attribute, however, the CURRENT clause is allowed with a non-scrollable cursor only when combined with the CONTINUE clause.
- CONTINUE was specified on the FETCH statement, but the specified cursor was opened for a multiple-row fetch operation. This combination is not supported.
System action
The statement cannot be processed. No data was written to the output host variables.
Programmer response
If a scrolling option was specified on the FETCH statement for a non-scrollable cursor, correct the FETCH statement to exclude the disallowed keyword, or, correct the DECLARE CURSOR statement to include the appropriate SCROLL option. If the CONTINUE clause was specified for a multiple-row cursor, change the application to use single row fetch for this cursor. If multiple-row fetch is required, use another technique, such as a LOB locator for retrieving large LOB or XML values.
SQLSTATE
42872