On 2016/07/05 5:18 PM, Dobrean, Adrian wrote:
My understanding is that as result of this command " PRAGMA journal_mode = off" the 
journal mode should get set to "PAGER_JOURNALMODE_OFF".
However in my case even though I get no error and the journal_mode stays set to "0" 
instead of "PAGER_JOURNALMODE_OFF " (which is 2).

That's easy then - your understanding is wrong!

The return value of that statement (assuming you check the return value of sqlite3_exec()) is an SQLite error code to say whether or not the statement succeeded (which I think 0 means it did succeed) and has nothing to do with the new Journal mode. You can now run a second statement being simply "PRAGMA journal_mode;" which should return again a normal SQLite error code to show the statement succeeded using the standard api sqlite3_prepareV2() or similar to get a prepared statement (like all other SQL SELECT queries that you have) and this time hopefully the error code returned would be indicating it has one row to read, (I think 101) and then reading the value of that single row and single field returned (as a query record set) will now give the value of what the new journal mode is.

Do not confuse the API functions' C-language return values with a result set returned for an SQL cursor / query row/column set - they are not the same thing.

That's about as verbose as I can make it - I hope it helps!

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

Reply via email to