Both functions are listed in code:
http://sourceforge.net/p/zeoslib/code-0 ... r.pas#l336
But used only first:
http://sourceforge.net/p/zeoslib/code-0 ... r.pas#l984
According to the SQLite documentation:
Main advantage of "_v2" is that "sqlite3_prepare_v2" will try to re-compile SQL statement if schema changes.sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are recommended for all new programs
I migrated to Zeos 7.1.2 from 7.0.3. And my software begin to crash with error "database schema has changed".
SQLite FAQ says:
So I changed both calls of sqlite3_prepare to sqlite3_prepare_v2:The easiest way to deal with SQLITE_SCHEMA errors is to always use sqlite3_prepare_v2() instead of sqlite3_prepare()
Code: Select all
{ Prepared statmenet api }
function TZSQLiteBaseDriver.Prepare(db: Psqlite; const zSql: PAnsiChar; nBytes: Integer;
out ppStmt: Psqlite3_stmt; pzTail: PPAnsichar): Integer;
begin
Result := SQLite_API.sqlite_prepare_v2(db, zSql, nBytes, ppStmt, pzTail);
end;
function TZSQLiteBaseDriver.Prepare_v2(db: Psqlite; const zSql: PAnsiChar; nBytes: Integer;
out ppStmt: Psqlite3_stmt; pzTail: PPAnsichar): Integer;
begin
Result := SQLite_API.sqlite_prepare_v2(db, zSql, nBytes, ppStmt, pzTail);
end;