开发者

Can't prepare PRAGMA queries on Android

开发者 https://www.devze.com 2022-12-22 05:37 出处:网络
Having this line Cursor c = db.rawQuery(\"PRAGMA table_info(?)\", new开发者_C百科 String[] {tableName});

Having this line

Cursor c = db.rawQuery("PRAGMA table_info(?)", new开发者_C百科 String[] {tableName});

and getting this: android.database.sqlite.SQLiteException: near "?": syntax error: , while compiling: PRAGMA table_info(?)

Do you know why?


Try temporarily hard-wiring in a table name. If that works, then you cannot use positional parameters for pragma parameters -- you'd just need to do some string concatenation yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号