react-native - 来自 JS 的格式错误的调用:字段大小不同。在反应天真的执行更新查询时
问题描述
我只是想更新我的 SQLite 数据库中的值,在执行查询时我收到一个错误,比如
来自 js 的格式错误的调用:字段大小不同。[[10,10],[1,1],[[{"executes":[{"params":[],"sql":"BEGIN","qid":1111},{"params":[ "one",91,8181818181,37],"sql":"更新 bidinfos" 设置 customerName = ?, customerCountryCode = ? , 客户手机号码 = ? 其中 id = ?","qid":1111}],"dbargs":{"dbname":"chitNoteDataBase.db"}},5168,5169]],2583]
我试过这样:
updateOfflineBidInfoData = async (chitMemberIndex, existingCustomerDetails) => {
debugger
try {
let fintechUpdateChit = {
"customerId": existingCustomerDetails.id,
"customerName": existingCustomerDetails.userName,
"customerCountryCode": existingCustomerDetails.countryCode.replace("+", ""),
"customerMobileNumber": existingCustomerDetails.mobileNumber,
}
alert(JSON.stringify(fintechUpdateChit))
db.transaction((tx) => {
tx.executeSql(
'Update BidInfos set customerId=?, customerName=?, customerCountryCode=?, customerMobileNumber=? where id = ?',
[Number(fintechUpdateChit.customerId), fintechUpdateChit.customerName, Number(fintechUpdateChit.customerCountryCode), Number(fintechUpdateChit.customerMobileNumber), Number(chitMemberIndex)],
(tx, results) => {
// alert('Results', results.rowsAffected);
// results.rows.length
if (results.rowsAffected > 0) {
alert("updated")
} else {
alert('not exe')
}
},
(error) => {
alert(error)
}
);
});
}
catch (error) {
alert(error)
}
}
请帮我弄清楚这个
解决方案
推荐阅读
- angular - Angular 8:无法迭代我的帖子对象
- .net-core - 具有自定义名称的 Azure Pipeline Pack Nuget 包
- html - 在移动视图中 - 在容器和桌面视图中带有填充的图片不会发生
- mysql - 有没有办法通过 mysqldump 命令使用数据库 url?
- sql - 无法创建视图,但其他语句运行正常。每个视图或函数中的列名必须是唯一的
- arraylist - 为什么我的 arraylist 大小在适配器页面上等于 0?
- git - 通过詹金斯错误向 github 进行身份验证
- regex - 跟踪 Ruby 正则表达式中的分隔符更改
- c# - 带有 EmguCV 的 CUDA 中的 SEHException
- python - Flask - 服务器端的定期检查