SQLITE_SCHEMA is returned only on failure.
But, here, there is not failure.

Maybe I should not store the column count ?
Maybe I should look at schema version
(http://sqlite.org/pragma.html#pragma_schema_version):
"The schema version is used by SQLite each time a query is executed to
ensure that the internal cache of the schema used when compiling the
SQL query matches the schema of the database against which the
compiled query is actually executed."
Is there a better solution ?

Thanks.

On Sat, Sep 19, 2015 at 3:21 PM, Kees Nuyt <k.nuyt at zonnet.nl> wrote:
> On Sat, 19 Sep 2015 11:29:37 +0200, gwenn <gwenn.kahz at gmail.com>
> wrote:
>
>>Hello,
>>Is there any way to know when a prepared statement is recompiled ?
>>For example:
>>
>>rc = sqlite3_prepare_v2(db, "SELECT * FROM test", -1, &stmt, NULL);
>>...
>>cc = sqlite3_column_count(stmt);
>>...
>>rc = sqlite3_exec(db, "ALTER TABLE test ADD COLUMN data DEFAULT
>>'missing'", NULL, NULL, NULL);
>>...
>>rc = sqlite3_step(stmt);
>>// how to know that the column count is not good anymore ?
>
> http://www.sqlite.org/rescode.html#schema
>
> --
> Regards,
>
> Kees Nuyt
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to