Sorry, the count thing was actually Mark Halegua's question. -- Darren Duncan

On 2014-08-27, 8:58 PM, Darren Duncan wrote:
On 2014-08-27, 8:41 PM, Keith Medcalf wrote:
this may seem like a small issue, but I'm not sure if the solutions I've
found on the web will do what I want in a low memory situation.  I'd like to
iterate through a table one row at a time.  I can do that in pysqlite, but I
don't see a method for determining I'm at the end of the file

Can anyone point me in the correct direction?  Again, it's a low memory
solution the the table could become quite large, so I don't want to load
the whole thing with a teychall() call, and I'm not sure if a cursor won't
take up too much memory as well.

Good that you asked about this here Keith.

Just use this SQL:

   select count(*) from table;

Its unfortunate that so many people are out there making websites or whatever
that don't know how to use SQL properly, and so they do things like "select *
from table" and then try to filter it in their application.

A main point of using a SQL database is using SQL to do the hard work of
reporting for you; if you find yourself doing non-trivial work on the
application side, you're probably missing out on a SQL feature.

So good that you asked about this, and you can do things smart rather than hard.

-- Darren Duncan

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

Reply via email to