On 10 Apr 2017, at 9:28pm, Reid Thompson <reid.thomp...@ateb.com> wrote:

> my questions are, if I prepare and utilize a statement for a result set
> in the tens of thousands (or more) using a where clause along the lines
> of
>    "ORDER BY batch_id, due_datetime, random()"
> 
> 1) As I sqlite3_step through the result set, am I guaranteed to get each
> row only once?

Yes.  _step() will return each row exactly once.  This assumes you will not 
make any changes to the table those rows are in until you have finished 
stepping.  If you make any changes to the table before the last call to _step() 
then things may get more complicated.

> 2) is the order set only once on the first sqlite3_step, or does it
> change with each sqlite3_step invocation?

Because no index already exists for that ORDER, you can imagine that SQLite 
makes up a temporary index for the results when you do the first 
sqlite3_step(), and deletes it when you execute sqlite3_reset() or 
sqlite3_finalize().

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

Reply via email to