tags:

views:

116

answers:

1

Having this line

Cursor c = db.rawQuery("PRAGMA table_info(?)", new String[] {tableName});

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

Do you know why?

+1  A: 

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.

CommonsWare
That was it. If I use string.format works great. A bug to submit.
Pentium10
Not sure whether that's an Android limitation or a SQLite limitation.
CommonsWare