You are creating 100 prepared statements, which probably takes a lot of memory.
What you really want to do is probably create one statement, get all
the data out of it, finalize it and then prepare the next statement
and get THAT data etc.

Regards,
Jonas

On Thu, Jun 26, 2008 at 5:03 PM, 申和平 <[EMAIL PROTECTED]> wrote:
> Hi, all
>
> I have met a very strange problem:
>
> I want to load some binary data from SQLite3 database into a defined
> structure, so I used the following codes:
>
> ==================================================
> Sqlite3_stmt * stat;
> For (int i = 0; i< 100; i++)
> {
> //Step1:
> sqlite3_prepare_v2(...)
>
> //Step2:
> while(SQLITE_ROW == sqlite3_step(...) )
> {
> ....................................
> }
>
> //Step3:
> sqlite3_finalize(stat)
> }
> ==================================================
>
> I found that when the codes were executed, too much memory was taken. Even I
> removed step2(the while loop), it still had the same phenomena.
> Did I do something wrong?
> Or it's a bug of SQLite3?
>
> Thanks
>
> Peace
>
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to