When using sqlite3_bind_text() (or a similar function) with
SQLITE_STATIC, how long does the pointer have to remain valid? As long
as the sqlite3_stmt is not finalized?
It is clear to me the following will cause no problem:
sqlite3_bind_text (stmt, column, "some text", -1, SQLITE_STATIC);
But what about this:
void some_func (const char* text)
{
sqlite3_stmt *stmt = 0;
sqlite3_prepare_v2 (db, sql, -1, &stmt, NULL);
sqlite3_bind_text (stmt, column, text, -1, SQLITE_STATIC);
sqlite3_step (stmt);
...
sqlite3_finalize (stmt);
}
In this case the pointer remains unchanged as long as the statement is
valid, but it can change afterwards. Is that a problem and should I use
SQLITE_TRANSIENT here?
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------