...
Although the cursor is used as above, the 3. FETCH process proceeds to some extent in the CURSOR FETCH stage, and the 'ERR-410D2 (266450) Fetch out of sequence' error occurs even though there are still records to be fetched at some point.
...
Code Block | ||
---|---|---|
| ||
non-autocommit mode DECLARE CURSOR OPEN CURSOR while(1) { 커서(CURSOR) FETCH CURSOR; if (sqlca.sqlcode == SQL_SUCCESS) { /* Execute change DML */ /* Perform COMMIT or ROLLBACK */ } else if (sqlca.sqlcode == SQL_NO_DATA) { ... } else { /* An error occurs at this stage when all the records in the first communication buffer are processed and then placed in the second communication buffer. */ ... } } |
...
Create a session that uses a cursor and a session that executes modified DML statements. It is described by defining it as CONN1 and CONN2, respectively.
Whenever cursor FETCH is executed in the session using the cursor (CONN1), change DML is executed in CONN2, and COMMIT or ROLLBACK is executed.
The session (CONN2) that executes the modified DML statement is set to non-autocommit mode.
...
Reference
...
Differences by version
...
Depending on the Altibase version, the error messages that occur in the same situation may be different.
The difference in error messages that occurs when COMMIT/ROLLBACK is executed among FETCHs in a non-autocommit environment is as follows.
...