Almost, I want to be able to compare sqlite3_stmt structures somehow and
be able to work out if given two pointers to a sqlite3_stmt are pointing
at the same query instance or not, as the address pointed to is not
sufficient. 

In the C++ system I have results objects are returning values from
SQLite queries via an internal pointer to a sqlite3_stmt held in another
C++ query object which the queries objects have a reference to.  As it
is possible to have multiple results objects per query object, I am
concerned that if the sqlite3_stmt (in the query object) was recycled
via finalize/prepare that it would mess up the remaining results objects
that were pointing to it unless those result objects could detect the
change of query themselves.

Thinking about it the function you link to would probably be sufficient.
If I either store the original query string or a hash of the query
string locally in each result object (as space is at a premium a hash
would be preferred).  I could then compare the value stored in the
results object against the value in the query object to determine if the
query object had been recycled or not...

Daniel

-----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