When I was trying to call the MySQL stored procedure using cursor.callproc() I encountered some problems. When there were multiple input and output parameters, there was no problem and everything works fine as following: I created procedure in MySQL like this with 5 input/output parameters:
create procedure enrollclass(in yeartime int, in quartertime char(20), in stid char(20), in course_no char(20), out result int)
and call procedure in python using something like this:
arg2 = ('2016', 'Q2', info[0][0], course_no, 0)
ac = cursor.callproc('enrollclass',arg2)
this worked fine. However, if I called another procedure with only one input parameter (with no output parameter) like this:
create procedure prerequisite( in course_no char(20))
and called the procedure using this line:
arg3 = ('INFO1101')
cursor.callproc('prerequisite', arg3)
then the system kept giving me error message 'args must be a sequence'. I have no idea how to fix it since I have no other argument to form a sequence. Could someone tell me what's going on here? Thanks!