首页 > 数据库技术 > 详细

使用mysqlclient执行存储过程报错2014 Commands out of sync; you can't run this command now

时间:2020-03-16 20:32:47      阅读:79      评论:0      收藏:0      [点我收藏+]

在连续执行存储过程,并且存储过程有返回查询结果时,报错2014 Commands out of sync; you can‘t run this command now;

参考https://blog.csdn.net/ice4026/article/details/37592715

需要使用cursor.nextset(),或者断开connect;

在mysqlclient中的cursor.callproc方法中有一段注释:

Compatibility warning: The act of calling a stored procedure
itself creates an empty result set. This appears after any
result sets generated by the procedure. This is non-standard
behavior with respect to the DB-API. Be sure to use nextset()
to advance through all result sets; otherwise you may get
disconnected.

 

使用mysqlclient执行存储过程报错2014 Commands out of sync; you can't run this command now

原文:https://www.cnblogs.com/shouwangrenjian/p/12505799.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!