If I am understanding you correctly, you are attempting to 'cache' prepared 
statements.

   My solution was to implement a wrapper function around the SQLITE3_PREPARE 
call function that stored pointers to the sql statement, the database handle, 
and the 'prepared' statement in a linked list. On subsequent calls the function 
would return the already prepared statement if one was present. The search of 
the list was based on the SQL text of the query. Various techniques such as 
using a hash or checksum of the SQL text as the initial search key will speed 
up the search.

   ( To the 'powers that be'... I wonder if some form of 'cache' for prepared 
statements might be built in to the 'sqlite3_prepare*' functions as a 
performance enhancement? )

Hope this helps.
*** Doug Fajardo


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of D. Richard Hipp
Sent: Thursday, November 06, 2008 4:54 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Distinguishing between sqlite3_stmts


On Nov 6, 2008, at 7:47 PM, Brown, Daniel wrote:

> Good afternoon list,
>
> Are there any methods for distinguishing between sqlite3_stmt
> structures
> prepared by sqlite3_prepare_v2?  I'd like to be able to tell if a
> statement structure has been finalized and then prepared with a
> different query programmatically.  Is there any sort of unique
> identifier in those prepared structures?


I'm not sure I understand the question.  Is http://www.sqlite.org/c3ref/sql.html
  what you are asking for?

D. Richard Hipp
[EMAIL PROTECTED]



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

Reply via email to