gpt4 book ai didi

Android SQLiteException : bind or column index out of range problem

转载 作者:IT老高 更新时间:2023-10-28 23:16:55 26 4
gpt4 key购买 nike

在 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 SQLiteException : bind or column index out of range problem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5716543/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com