我正在使用 to_sql 将表附加到 Oracle 中。但是,我收到以下错误
(cx_Oracle.DatabaseError) ORA-01843: not a valid month [SQL: 'INSERT ... INTO
我试图为表中的日期列定义列类型
d_type_date = {c: types.DateTime for c in
data.columns[data.dtypes.isin(['datetime64[ns]', '<M8[ns]'])].tolist()}
然后将其作为参数传递给 to_sql
self.final_data.to_sql(table
, con=connection
, schema=schema
, if_exists='append'
, index=False
, dtype=d_type_date)
但我仍然遇到同样的错误。我读到它可能是 NLS_DATE_FORMAT,但我不确定如何解决这个问题