Python mysql stored procedure callproc() doesnt work

Viewed 481

I have a stored procedure on mysql database.When I call this procedure on 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

  cadres='Deneme'
  mycursor = mydb.cursor()
  mycursor.callproc('bakiyesifirla',[cadres,])
  mycursor.close()

it doesnt give any error but it wont make any difference.

1 Answers

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

Related