On 7 Jun 2012, at 2:24pm, IQuant <sql...@iquant.co.cc> wrote:

> Looking through the code I noticed sqlite3_exec(db, zSQL, 0, 0, 0);
> wrapped inside transaction.
> Suspect this is causing the CPU load, going to try recoding using
> prepared statements.

There's nothing wrong with sqlite3_exec that will causes excessive CPU usage, 
but the above usage of it suggests someone put that together quickly.  The last 
three parameters should be more like

NULL, 0, &zErrMsg

showing no callback, a dummy argument for the non-existant callback, and 
somewhere for SQLite to put an error message if there is one.  Even if you 
burst the _exec() into _prepare(), _step(), _finalize(), you'll still have to 
provide the equivalent parameters somewhere.

I don't know whether using 0, 0, 0 when there is no error will cause any 
problems.  I suspect not.

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

Reply via email to