I'm trying to get the callproc() method working in version 1.2.1_p2. But unfortunately I end up with the ProgrammingError called "execute() first".
After having taken a peek at the cursors.py it seems to me that there might be an error in it. The use of _executed/_last_executed attributes seems a bit flawed to me, but sinced i'm only halfway into my first week of dealing with Open Source I'm rather reluctant to report this as a bug before having tried my luck with the users in this forum. :)
My question in short is this: Have any of you had any experience - good or bad - with the callproc() in 1.2.1_p2?
Regards,
Ulrik
This is my code:
import MySQLdb
Create a connection object and create a cursor
Con = MySQLdb.Connect(host="192.168.99.63", port=3306, user="itborger", passwd="tuttelut", db="test")
Cursor = Con.cursor()
Use callproc to execute a sproc
Cursor.callproc("sp_GetPerson_r")
Fetch all results from the cursor into a sequence
Results = Cursor.fetchall()
Closing the cursor - to avoid errmsg from that extra resultset returned
Cursor.close()
Close the connection
Con.close()
Print the sequence
print Results
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I'm trying to get the callproc() method working in version 1.2.1_p2. But unfortunately I end up with the ProgrammingError called "execute() first".
After having taken a peek at the cursors.py it seems to me that there might be an error in it. The use of _executed/_last_executed attributes seems a bit flawed to me, but sinced i'm only halfway into my first week of dealing with Open Source I'm rather reluctant to report this as a bug before having tried my luck with the users in this forum. :)
My question in short is this: Have any of you had any experience - good or bad - with the callproc() in 1.2.1_p2?
Regards,
Ulrik
This is my code:
import MySQLdb
Create a connection object and create a cursor
Con = MySQLdb.Connect(host="192.168.99.63", port=3306, user="itborger", passwd="tuttelut", db="test")
Cursor = Con.cursor()
Use callproc to execute a sproc
Cursor.callproc("sp_GetPerson_r")
Fetch all results from the cursor into a sequence
Results = Cursor.fetchall()
Closing the cursor - to avoid errmsg from that extra resultset returned
Cursor.close()
Close the connection
Con.close()
Print the sequence
print Results