I have two database files. One in Rollback mode and the other in WAL mode.
I am able to serialize, deserialize and prepare a SQL query against the
rollback database. When I do the same against the WAL database file, the
'prepare' statement fails with code '1'. Is it not possible to do this on
WAL based database file? A sample code fragment is given below-

sqlite3 *dbHandle=nullptr;
if (sqlite3_open_v2("db_filename", &dbHandle, SQLITE_OPEN_READONLY, NULL)
!= SQLITE_OK){//error}

sqlite3_int64 sz=0;
unsigned char* mem=sqlite3_serialize(dbHandle,"main",&sz,0);

if(sqlite3_deserialize(dbHandle, "main", mem, sz,
sz,SQLITE_DESERIALIZE_READONLY) != SQLITE_OK){//error}

char* Query = "select * from test";
sqlite3_stmt *statement = nullptr;
int res=sqlite3_prepare_v2(dbHandle, Query, strlen(Query), &statement, 0);
//res is 1 for WAL


Thanks,
   Lloyd
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to