在android中,我正在使用以下语句。
model = dataHelper.rawQuery("SELECT _id, engword, lower(engword) as letter FROM word WHERE letter >= 'a' AND letter < '{' AND engword LIKE '%" + filterText + "%'", new String[ {"_id","engword", "lower(engword) as letter"});
它正在抛出
android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x132330
我的代码有什么问题?
最佳答案
正确的声明是:
model = dataHelper.rawQuery("
SELECT _id, engword, lower(engword) as letter
FROM word W
HERE letter >= 'a'
AND letter < '{'
AND engword LIKE ? ORDER BY engword ASC
",
new String[] {"%" + filterText + "%"}
);
关于android - Android SQLiteException : bind or column index out of range problem,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5716543/