SQLiteException: unrecognized token:
来源:互联网 发布:邮件服务器软件价格 编辑:程序博客网 时间:2024/06/07 07:07
在往数据库更新数据时出现android.database.sqlite.SQLiteException: unrecognized token: "33xo8cgMSaRqZNs0bS2ol2RxIsqfOKUj8Dyb7sMN" (code 1): , while compiling: update Book1 set face_id =33xo8cgMSaRqZNs0bS2ol2RxIsqfOKUj8Dyb7sMN where image_id=24478
sql语句:
//把faceId插入Book1 public void addFaceId(int imageId,String faceId){ db = mDatabaseHelper.getWritableDatabase(); db.execSQL("update Book1 set face_id ="+faceId+" where image_id="+imageId);}
后发现是字符串没加单引号。
原来sql语句中如果有字符串,必须用单引号‘’把字符串括起来。
例如:update Book1 set face_id ='faceId' where image_id=imageId;
faceId是一个字符串
不能是update Book1 set face_id =faceId where image_id=imageId;
正确的写法应该是:
//把faceId插入Book1 public void addFaceId(int imageId,String faceId){ db = mDatabaseHelper.getWritableDatabase(); db.execSQL("update Book1 set face_id ='"+faceId+"' where image_id="+imageId);}
阅读全文
0 0
- SQLiteException: unrecognized token:
- android- 数据库 模糊搜索, 单引号 ’ 报错问题(SQLiteException: unrecognized token: “‘)
- 解决windows phone中使用sqlite时报SQLiteClient.SQLiteException: unrecognized token错误
- sqlite3.OperationalError: unrecognized token: ":"
- sqlite3.OperationalError: unrecognized token: ":"
- sqlite3.OperationalError: unrecognized token: ":"
- iar Error[Pe007]: unrecognized token
- DB Error: 1 "unrecognized token: ":""
- sqlite 出现 unrecognized token: "xxxx"
- DB Error: 1 "unrecognized token: ":""
- ..\main.c(173): error: #7: unrecognized token
- keil u4 编译出现unrecognized token解决方法
- 数据库操作添加数据 出错 unrecognized token:
- OpenCL Bug: Unrecognized Token during Kernel Compilation
- Warning: Cannot read drop down range Unrecognized token 43
- sqlite数据库存入的时候出现 unrecognized token: ""错误
- Unrecognized token 'xxxx': was expecting ('true', 'false' or 'null')
- fasterxml: Unrecognized token '***': was expecting ('true', 'false' or 'null')
- python之字符串格式化(format)
- 11.20第13节课
- MongoDB基本命令用法
- 利用 TensorFlow 实现排序和搜索算法
- 单链表实现队列链式存储
- SQLiteException: unrecognized token:
- LeetCode--Symmetric Tree
- 100+大数据开源处理工具汇总
- java学习一站式资料下载(项目源码及视频)
- Java使用线程池和线程工厂
- 通过docx4j完美合并docx
- ubuntu16.04安装rabbitVCS
- 条形码、二维码的生成与扫描、解析本地二维码
- github fork到pull request的基础流程