nick huang wrote:
> For example, query statement is something like "select * from
> sometable order by somefield;" and we call prepare followed by step.
> And are all results returned from "step" in order of "somefield"?

Of course. What would be the point of specifying "order by somefield" 
otherwise?

> As I read the document, it seems the step will return the first
> awailable row ASAP. That is why I wonder the sorting is not possible
> as according to what we learned from books the sorting of dataset is
> done at the last stage of SQL query when all result set is available.

ASAP stands for "as soon as possible". For a query with ORDER BY clause, 
"possible" is after the whole resultset is retrieved and sorted 
(assuming the order cannot be satisfied using an index).

> However, this also seems to contradictive to that all other query API
> like "exec", "getTable" etc. which all support "sorting" are all
> based on prepare-step. Therefore the only conclusion is that "exec",
> "getTable" etc. retrieve dataset and sort by themselves after they
> call "prepare-step".

You can look at the source code for sqlite3_exec and sqlite3_get_table, 
and convince yourself that they do no such thing.

Igor Tandetnik 



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

Reply via email to