I have a data which contains student's age. For some students, the age is not available, therefore I want to store empty values for those in the databse. I am trying the below code but it is giving me error on passing the null value.
Column('studentAge', NUMERIC, nullable=True)
I am getting the below error:
DataError: (psycopg2.DataError) invalid input syntax for type numeric: ""
I am executing the below query for inserting the data which is giving me error:
student_id= "1234", student_name="Timothy", student_age=""
ins = table.insert().values(
studentId=student_id,
studentName=student_name,
studentAge=student_age)
conn = engine.connect()
conn.execute(ins)