Android Studio 3.1
purpose: update version number of sqlite database
error
expected, got '?'
the code caused error was
db.execSQL("PRAGMA user_version = ?", new Object[]{questionDbVersion});
android.database.sqlite.SQLiteException: near "?": syntax error (code 1): , while compiling: PRAGMA user_version = ? at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
but in the Sql environment, the sql sentence worked well
PRAGMA user_version =1
PRAGMA user_version
PRAGMA user_version =2
What should I do?
============ I found a solution
db.setVersion(questionDbVersion);