Thanks Igor,
I just imagined that when the engine calculates a 'count(*)' it doesn't loop on 
each result row "just" for counting,
and thus I thought there could be some function on client side to use that 
supposed algorithm.

-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] la part de Igor Tandetnik
Envoyé : mercredi 5 novembre 2008 14:38
À : sqlite-users@sqlite.org
Objet : Re: [sqlite] row count after a select


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Do you know a way to count the number of rows identified by a select
> statement, just after the first call to sqlite3_step ? Of course
> without fetching the entire result set, nor having to systematically
> add count(*)

You seem to believe SQLite retrieves the whole resultset on the first 
sqlite3_step call. This is not the case. SQLite produces records one by 
one, on request, every time you call sqlite3_step. It simply doesn't 
know how many there are going to be, until on some sqlite3_step call it 
discovers there are no more.

Igor Tandetnik 



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

This mail has originated outside your organization, either from an external 
partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be 
disclosed or used by anyone other then the addressee. Access to this e-mail by 
anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and 
delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of 
this e-mail as it has been sent over public networks. If you have any concerns 
over the content of this message or its Accuracy or Integrity, please contact 
Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus 
scanning software but you should take whatever measures you deem to be 
appropriate to ensure that this message and any attachments are virus free.

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

Reply via email to