-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shaun Seckman (Firaxis) wrote:
> Is there any way to duplicate a sqlite3_stmt instance?  

Call sqlite3_sql to get the original SQL text and then call prepare on
that.  http://sqlite.org/c3ref/sql.html

> My only reasoning for doing
> this is to bypass the byte code compilation of the SQL statement, 

There is no official way to duplicate the sqlite_stmt internals
(bypassing compilation).

The way to work around this is to have a statement cache, but allow it
to be multi-valued.  ie it should allow multiple sqlite3_stmt to exist
for the same SQL text.  (You would need to do this anyway if you can
have multiple statements executing or using the same connection across
threads.)  When a sqlite3_stmt is no longer needed, reset it and return
to the cache.  Any reasonable cache will then end up with a working set
corresponding to the statements and instances of sqlite3_stmt that you use.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAko6rJ0ACgkQmOOfHg372QQizwCeKmjSjTzoG3ODNuSkVSBKSlfF
VkcAoNiJWQtsVrBOdKyWSxIty75sDIYU
=UBPh
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to