Android SQLiteException: bind or column index out of range problem

前端 未结 3 936
自闭症患者
自闭症患者 2021-02-12 23:44

In android I am using the following statement.

model = dataHelper.rawQuery(\"SELECT _id, engword, lower(engword) as letter FROM word WHERE letter >= \'a\' AND         


        
3条回答
  •  星月不相逢
    2021-02-13 00:32

    The right statement is :

    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 + "%"}
    );
    

提交回复
热议问题