I'm trying to call a stored function from Python code. If I use:
import mysql.connector
from datetime import datetime
with ... as conn
c = conn.cursor()
func = "SELECT get_customer_balance(%s, %s)"
customer_id = 577
dt = datetime(2015, 6, 30, 18, 5, 30)
result = c.execute(func, (customer_id, dt))
val = result.fetchone()
But result.fetchone() call fails because the result is None.
I tried also driver's callproc method used for stored procedures, but it fails as it does not recognize get_customer_balance (since it is a stored function).
I can't find any information about this. Would really appreciate some help.
Thanks.