[英]Python mysql stored procedure callproc() doesnt work
I have a stored procedure on mysql database.When I call this procedure on phpmyadmin我在 mysql 数据库上有一个存储过程。当我在 phpmyadmin 上调用这个过程时
CALL bakiyesifirla('Deneme');
CREATE PROCEDURE bakiyesifirla(IN cadres varchar(500))
BEGIN
set @bakiye=0;
CALL bakiyecek(cadres,@bakiye);
IF @bakiye<0 THEN
CALL bakiyeguncelle(0,cadres);
END IF;
END; –
it works fine but when I try to call it on python with它工作正常,但是当我尝试在 python 上调用它时
cadres='Deneme'
mycursor = mydb.cursor()
mycursor.callproc('bakiyesifirla',[cadres,])
mycursor.close()
it doesnt give any error but it wont make any difference.它不会给出任何错误,但不会有任何区别。
use a tuples not arrays使用元组而不是数组
mycursor.callproc('bakiyesifirla',(cadres,))
But i can't see how you can check, if the procedures are called or not.但是我看不到您如何检查程序是否被调用。
Add some out paramters to check,if also the sub stored procedures are running see the link provided添加一些输出参数进行检查,如果子存储过程也在运行,请参阅提供的链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.