Android where 长度限制

来源:互联网 发布:flotherm软件正版价格 编辑:程序博客网 时间:2024/05/29 12:34

SQLiteDatabase操作数据库时,如下语句:

【1】

SQLiteDatabase db = openDB();int count = db.delete("QuestionInfo", "QuestionCode="+sQuestionCode, null);

如果sQuestionCode字符串为“11630720120515152819”时,返回count=0,获取不到数据

结果测试把语句修改为如下传参数:

【2】

SQLiteDatabase db = openDB();String[] whereArgs = {sQuestionCode};int count = db.delete("QuestionInfo", "QuestionCode = ?", whereArgs);

测试结果count=1,为什么换成这样传参数就可以成功

 

另外又测试把sQuestionCode字符串变为“11630720120515”,使用第一种方法,返回count=1,结果也成功

难道SQLiteDatabase条件字符串长度有限制???

 

QuestionCode字段定义如下:

QuestionCode TEXT PRIMARY KEY





 

原创粉丝点击