79473033

Date: 2025-02-27 14:49:55
Score: 0.5
Natty:
Report link

found solution here: The type of <field> is not a SQLAlchemy type with Pandas to_sql to an Oracle database

pd.DataFrame({'col1':['a','b','c','dd'], 'col2':[11,22,33,44]}).to_sql(
   name='test',
   con=con, 
   if_exists='append',
   index=None,
   dtype={'col1':types.VARCHAR(length=20)})
con.commit()

enter image description here

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: frank