Jay A. Kreibich wrote:
>   You quoted the backward example, but I'm going to use the forward version.
> 
>   In addition to the "last seen title", remember the RowID for every row
>   with the same "last seen title".
> 
>   For the forward query use "AND title>=:firsttitle" and pitch rows
>   that match any of the remembered RowIDs.  (Backwards use "<=".)
> 
>   You'll also need to increase your LIMIT by the number of RowIDs you
>   remembered.  If you don't end up pitching rows and get a full set of
>   data before the LIMIT is hit, you can just call _finalize on the
>   statement.

Thanks.

It seems remembering the rowids would be a bit cumbersome and 
potentially error prone esp when you change from scroll down to scroll 
up.  I think you might get the same result by remembering the last seen 
title and its rowid.  In the next query, dump any rows where (title = 
last_seen_title) and (rowid != last_seen_rowid).

Also considered trying to make a sort of signum user defined function 
that might be able to mask off the rows right in the select statement. 
I haven't done a custom function yet though, so I'm not sure if it would 
work.

The other thought was to simulate a bidirectional or random-access 
cursor by first doing a query for rowids and then doing a query for the 
specific row when requested.  Less than ideal certainly, but was more 
along the line of what the gui folk want to deal with in the first place.

Its yuk all around ...

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to