Overview
This document describes an error that occurs during the record fetch process by using a cursor to process a select statement that returns multiple records.
Version
Altibase 4.3.9
Symptom
To process a query statement that returns multiple records, a CURSOR must be used in the following process.
- DECLARE CURSOR
- OPEN CURSOR
- FETCH CURSOR
- CLOSE/RELEASE CURSOR
Although the cursor is used as above, the 3. FETCH process proceeds to some extent in the CURSOR FETCH stage, and the 'ERR-4103C (266300)' error Request of fetching data to an unprepared SQL statement.' occurs even though there are still records to be fetched at some point.
Below is an example where an error occurs when using the cursor and the result of the error.
Cause
When COMMIT/ROLLBACK is performed in the OPEN CURSOR state
Altibase complies with the ANSI standard and is configured not to support the fetch across commit method by default. Therefore, if COMMIT or ROLLBACK is performed after opening the cursor, the cursor is forcibly closed according to the ANSI standard.