码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2020-03-16 18:55:38      阅读:94      评论:0      收藏:0      [点我收藏+]

标签:get   bsp   行存储   tps   ext   and   details   lin   man   

在连续执行存储过程,并且存储过程有返回查询结果时,报错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

标签:get   bsp   行存储   tps   ext   and   details   lin   man   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!