SQLITE and PRAGMA

fatman

Active Member
Licensed User
Longtime User
Hi Erel,

in this old thread (http://www.b4x.com/forum/basic4android-updates-questions/13681-sqlite-wal-shm.html#post90354) you stated this code

sql.ExecNonQuery("PRAGMA journal_mode=DELETE")

My code is like that and returns an error at runtime:

SQL1.Initialize(mydir, Myfile, False)
'
SQL1.ExecNonQuery("PRAGMA journal_mode=DELETE")

If I delete the line with the pragma-statement my app is running fine...

What is wrong with the pragma-statement?

Thanx in advance

Fatman
 

fatman

Active Member
Licensed User
Longtime User
Hi Erel,

I´m using Andoid 3.1 and the error message is:

android.database.sqlite.SQLiteException: unknown error: Queries can be performed using SQLiteDatabase query or rawQuery methods only.

The logs shows more or less the same.

Fatman
 
Upvote 0

fatman

Active Member
Licensed User
Longtime User
Thank you very much Erel!
This helped me to increase the speed of my sqlite databases.

Fatman
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
You can do this:
B4X:
Dim MyJournal As String
MyJournal=SQL1.ExecQuerySingleResult("PRAGMA Journal_mode") 
Log("Myjournal: " & MyJournal)  'displays the mode type of your database
 
Upvote 0
Top