sqlite 二进制 数据的修改
修改 sqlite 中的二进制文件 如下: 1.执行修改语句update tb set content=? where id=x 2.重新设置参数长度sqlite3_bind_zeroblob(stmt,1,len); 第三个参数就是修改后的长度。//bind_zeroblob可以用于几个G的数据写入 3.SQLITE_API int sqlite3_blob_open( const char *zColumn,//列名 sqlite3_int64 iRow,//行号 int flags,//If the flags parameter is non-zero,then the BLOB is opened for readand write access.If it is zero,the BLOB is opened for read access. 主要目的: 获得需要修改行的文件句柄;
4.sqlite3_blob_write(..) 写入数据; // 在sqlite3_blob_open之后你可以任意次调用sqlite3_blob_write写入数据,只要不超过sqlite3_bind_zeroblob中设定的长度就可以了。
5.sqlite3_blob_close关闭
以上为获取自网上主键,总感觉不如直接删除,然后插入一个新的来方便; 或者在某些不能项里面有用吧!
2.执行修改语句update tb set content=? where id=x 3.重新设置参数长度sqlite3_bind_zeroblob(stmt,len); 第三个参数就是修改后的长度。//bind_zeroblob可以用于几个G的数据写入 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |