my problem is that I would like to retrieve a result set from the database with columns having different data types, it works fine with all data types except floating points.
I get this error" TypeError: Object of type 'Decimal' is not JSON serializable "
I read some solutions like https://stackoverflow.com/a/3885198/6079156 but I don't know how to use them to solve my problem. sample code:
from flask import render_template
def employee():
# salary's data type is decimal(8,2) in the database
cursor.execute("SELECT ID, dateofbirth, type, salary FROM employee")
result= cursor.fetchall()
return render_template('Employee.html', result=result)