开发者

Can't prepare PRAGMA queries on Android

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜