On 6/27/07, Krishnamoorthy, Priya (IE10)
<[EMAIL PROTECTED]> wrote:

        for (int i=1;i <= b.numRows() ; i++)

           sql_command.format("select Data from %s where Row_Num =
%d;",table_name,i);

           q = db.execQuery(sql_command);

           if (!q.eof())

This method works fine only when the table size is small. For example, I
have a database of size over 2GB in which case I get an error
SQLITE_NOMEM when I try to do db.gettable(). But i need to know the
number of rows in the table for reading BLOB data in each of the rows
one after another.

Why?  The query wrapper appears to support iteration, since it has a
notion of "eof".  Why do you need the row count ahead of time?  Why do
you assume it's a monotonic sequence (no gaps)?

If you really do need the row count for some reason, you can construct
a query to give it to you, without retrieving all the data.  And since
you retrieved all the data at once in the first place, why are you
retrieving it again anyway?

I'm getting confused just trying to analyze what you're doing.  I
think you need to stop and think about what you really want to do :)

Secondly, the column "Row_Num" is of type INTEGER_PRIMARY_KEY. So, it
will take negative value after 2GB as mine is a 32 bit machine.

SQLite integers are 64 bits, so the database will have no issue.  If
your wrapper is only capable of giving you 32 bit integers, you'll
have to get a different wrapper.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to