繁体   English   中英

使用fmdb无法更新Blob类型数据

[英]using fmdb can't update blob type data

当我查询,删除或插入数据库时​​,FMDB工作正常,但是当我尝试更新数据库时,返回YES,但实际上并没有任何改变。

这是更新数据的代码:(这不起作用)

 [_db executeUpdateWithFormat:@"UPDATE t_jewel_template SET data = %@ WHERE idstr = %@;", bookData, bookId];

这是插入数据的代码:(工作正常)

 [_db executeUpdateWithFormat:@"INSERT INTO t_jewel_template(data, idstr) VALUES(data, idstr);", bookData, bookId];

这是删除数据的代码:(工作正常)

 [_db executeUpdateWithFormat:@"DELETE FROM t_jewel_template WHERE idstr = %@;", bookId];

该表的架构为:

CREATE TABLE IF NOT EXISTS t_jewel_template (id integer PRIMARY KEY, data blob NOT NULL, idstr text NOT NULL);

不要使用executeUpdateWithFormat:(实际上,它将在FMDB 3.0中消失)。

而是使用executeUpdate:和? 占位符。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM