dbstmt.fetch() Ignores Orientation SQL_FETCH_RELATIVE and Offset
Issue #46
resolved
The fetch() call seems to ignore orientation == SQL_FETCH_RELATIVE and offset. See attached example script. The first fetch() call should move the cursor 10 rows from the start of the result set.
Run the script and compare the results vs. running the same query interactively. The results are identical, meaning the fetch() call with SQL_FETCH_RELATIVE did not move the cursor 10 rows.
Comments (6)
-
Account Deactivated -
Account Deactivated -
assigned issue to
-
assigned issue to
-
Account Deactivated @DavidRosson Seems we can not set the scrollable attribute directly. We have to set the cursor type to SQL_CURSOR_DYNAMIC then the cursor become scrollable automatically.
dbstmt.setStmtAttr(db2i.SQL_ATTR_CURSOR_TYPE, db2i.SQL_CURSOR_DYNAMIC); // dbstmt.setStmtAttr(db2i.SQL_ATTR_CURSOR_SCROLLABLE, db2i.SQL_TRUE); console.log("Scrollable is " + dbstmt.getStmtAttr(db2i.SQL_ATTR_CURSOR_SCROLLABLE));
SetStmtAttr() attr = 10050, value = 2, sqlReturnCode = 0 GetStmtAttr() attr = 10015, value = 1, sqlReturnCode = 0 Scrollable is 1
-
Account Deactivated Refined corresponding debug information with commit 6cd8d8e
-
Account Deactivated Refined the docs with commit 346e2cf and I will close this issue.
-
Account Deactivated - changed status to resolved
- Log in to comment
Hello @DavidRusso , Seems the scrollable attribute is not set succesfully -->
Debug: