文章详情页
python - 使用sqllite的conn.total_changes()问题
浏览:91日期:2022-08-14 08:47:19
问题描述
版本3.5
def Exec(self, sql, param=None):conn = sqlite3.connect(self.path)try: if param is None:conn.execute(sql) else:conn.execute(sql, param) conn.commit()except Exception as err: print(err)finally: result = conn.total_changes() conn.close()return result
sql 是 insert into Config values(null,’aaa’,’aaa’,’2017-03-30’,0)然后 result = conn.total_changes()位置报错’int’ object is not callable
问题解答
回答1:意思就是conn.total_changes是个int。result = conn.total_changes 就行,不要加()
相关文章:
1. windows误人子弟啊2. 冒昧问一下,我这php代码哪里出错了???3. MySQL主键冲突时的更新操作和替换操作在功能上有什么差别(如图)4. python - linux怎么在每天的凌晨2点执行一次这个log.py文件5. 数据库 - Mysql的存储过程真的是个坑!求助下面的存储过程哪里错啦,实在是找不到哪里的问题了。6. 实现bing搜索工具urlAPI提交7. mysql优化 - MySQL如何为配置表建立索引?8. 如何用笔记本上的apache做微信开发的服务器9. 我在网址中输入localhost/abc.php显示的是not found是为什么呢?10. 关于mysql联合查询一对多的显示结果问题
排行榜
