[DB-SIG] Extensions to DB API 2.0

brian zimmer bzimmer@ziclix.com
Sat, 12 Jan 2002 23:59:47 -0600


>     Cursor Method .scroll(value[,mode='relative'])
> 
>        Scroll the cursor in the result set to a new position according
>        to mode.
>        
>        If mode is 'relative' (default), value is taken as offset to
>        the current position in the result set, if set to 'absolute',
>        value states an absolute target position.
> 
>        An IndexError should be raised in case a scroll operation would
>        leave the result set. In this case, the cursor position is left
>        undefined (ideal would be to not move the cursor at all).
> 
>        Note: This method should use native scrollable cursors, if
>        available , or revert to an emulation for forward-only
>        scrollable cursors. The method may raise NotSupportedErrors to
>        signal that a specific operation is not supported by the
>        database (e.g. backward scrolling).
> 
>        Warning Message: "DB-API extension cursor.scroll() used"

In implementing .scroll() for zxJDBC the underlying JDBC result set's
absolute scrolling allows for negative numbers for value.  The result
set then counts backwards from the end of the set much like a Python
sequence.  I was wondering if the DB API .scroll() supported the same
semantics?  What should happen for .scroll(-1, "absolute")?  Is this an
IndexError or does .rownumber become the last row in the result set?

thanks,

brian