Hi,
I am working with a MySQL database and am having trouble with the line(s) of code that returns values when using a stored procedure that will return a single value.
When using a select statement, the following works perfect
Thanks in advance
Todd
I am working with a MySQL database and am having trouble with the line(s) of code that returns values when using a stored procedure that will return a single value.
When using a select statement, the following works perfect
cursor.execute(query)
data = cursor.fetchall()
cursor.close()
cnx.close()
return {'statusCode': 200,
'Content-Type': 'application/json'},
"body": json.dumps(data)}the following example works fine for my sp but i’ve never had to return a value from the spcursor.callproc('sp_h', args)
cnx.commit()
cursor.close()
cnx.close()
return {
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
},
"body": json.dumps({
"message": "Combination(s) Successfully inserted"
})
}What would I need to add to send back the single value into the body??Thanks in advance
Todd
