i have a stored procedure that contains multiple statements simplified as below
create temp table...;
update temp table...;
....
select * from temp table; #last statement
I have below Python code to get return results from the SP. I need the column names so that I can convert the results into JSON format. However, cursor.description returns nothing I expect. Advise please!! Mysql5.7, mysql-python-connector 2.x by Oracle, python 3.5
cursor.callproc(proc, args)
columns = cursor.description
print(columns) #returns [('@_sp_get_toc_arg1', 8, None, None, None, None, 1, 128)]
for result in cursor.stored_results():
return result.fetchall()