My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 16: Implement SQLFetchScroll
1 person starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  ----
Closed:  Dec 2008


 
Reported by ondrej.s...@gmail.com, Dec 26, 2008
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 26, 2008
Project Member #1 mkleehammer
(No comment was entered for this change.)
Status: Accepted
Labels: -Type-Defect Type-Enhancement
Dec 30, 2008
Project Member #2 mkleehammer
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
Project Member #3 mkleehammer
(No comment was entered for this change.)
Status: Complete

Powered by Google Project Hosting