| Issue 16: | Implement SQLFetchScroll | |
| 1 person starred this issue and may be notified of changes. | Back to list |
In Python based Web applications it is important to do pagination. SQL syntax for this varies from a server to server (limit by, ROW_NUMBER() OVER () etc). However ODBC function SQLFetchScroll provides a mechanism that could be used to retrieve just a window of resulting data set in DBMS independent way. It could work as follows: a new method skip(count) on Cursor objects would use SQLFetchScroll to skip a given number of rows.
Dec 30, 2008
Added in 2.1.3 SQLFetchScroll is more flexible than the functionality you are looking for, and different uses require different kinds of cursors. So, I've taken the easy way for now and added skip(count), as you suggested, which only moves forward. It could return the new row with little overhead (it is a fetch operation), but I would expect most uses to separate the skip and fetch, so it returns None for now. It seems simpler. I imagine the parameter will often be the result of a calculation, and the calculation will usually be 0 for the first page. To simplify implementations, it accepts zero (which of course is a no-op).
Status:
Verified
Nov 21, 2010
(No comment was entered for this change.)
Status:
Complete
|
Labels: -Type-Defect Type-Enhancement