GetTable will retrive entire snapshot of our table.I guess u app
is a 32bit application hence u can maximum access 2GB of user address space.
Upgrade to 64bit to access beyond this limit.


regards
ragha
PS:Sqlite is designed for small data sets amied at Embedded apps

******************************************************************************************
 This email and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!
 
*****************************************************************************************

----- Original Message -----
From: "Krishnamoorthy, Priya (IE10)" <[EMAIL PROTECTED]>
Date: Thursday, June 28, 2007 1:21 pm
Subject: [sqlite] FW: BLOB data retrieval

> Hi,
> 
> 
> 
> I have a database which has a table that contains BLOB data. The table
> has two columns - one is "Row_Num" which is of type AUTO_INCREMENT
> (INTERGER_PRIMARY_KEY) and the other column "Data" contains BLOB data.
> 
> 
> 
> I am writing a program (in MS VC++) which has to read the blob 
> data in
> all the rows of the above mentioned table one after another. I am 
> usingcppSQLite3 which is C++ wrapper function for accessing 
> sqlite3 db. Mine
> is an offline program that reads the data in the database which is
> updated by another program.
> 
> 
> 
> I wrote the following code for reading from the database.
> 
> 
> 
>         CppSQLite3DB    db;
> 
>        CppSQLite3Buffer bufSQL;
> 
> 
> 
>        // Open the database. The name is provided by the user
> 
>        db.open(database_name);
> 
>        // Read the entire binary table
> 
>        bufSQL.format("select * from %s order by 1;",table_name);
> 
>        CppSQLite3Table b = db.getTable(bufSQL);
> 
>        CppSQLite3Binary blobz;
> 
> 
> 
>        // Read binary records one at a time from the database 
> until all
> the records are read
> 
>        for (int i=1;i <= b.numRows() ; i++)
> 
>        {
> 
>           CppSQLite3Query q; 
> 
>           CppSQLite3Buffer sql_command;
> 
>           long length = 0;
> 
>          
> 
>           // Read binary record from row number "i"
> 
>           sql_command.format("select Data from %s where Row_Num =
> %d;",table_name,i);
> 
>           q = db.execQuery(sql_command);
> 
>           
> 
>           if (!q.eof())
> 
>           {
> 
>               blobz.setEncoded((unsigned char*)q.fieldValue("Data"));
> 
>               cout << "Retrieved binary Length: " <<
> blobz.getBinaryLength() << endl;
> 
>           }
> 
> 
> 
>           const unsigned char* pbin = blobz.getBinary();
> 
>        }
> 
> 
> 
> 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.
> 
> 
> 
> Please let me know how I can go about doing this?
> 
> 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.
> 
> So, how do I access data beyond 2 GB?
> 
> 
> 
> Please help me in this regard.
> 
> 
> 
> Regards,
> 
> Priya
> 
> 
> 
> 

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

Reply via email to