hi, 

 

Thanks for your reply. 

 
> 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?
> 

 

I cannot agree with you any more.


> > 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).
> 

 

This is just the usual case when all query results are retrieved and then 
sorted. What I am insterested in is if there is any method to get the sorted 
rows by "step" as I am working on mobile phone system where time-consumed 
operation would probably reset the system. If sqlite's prepare cannot do better 
than "execute" in this aspect, then what is meaning to use prepare/step? The 
document says sqlite is especially suitable for embedded system and that is why 
I wonder if sqlite has some revolutionary way to solve this problem.

 


> > 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.
> 

The source code is a bit complex and at this stage I am still doing some 
feasibility study for evaluation. 


> Igor Tandetnik 
> 


nick


_________________________________________________________________
Stay in the loop and chat with friends, right from your inbox!
http://go.microsoft.com/?linkid=9671354
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to