I am using to_sql to append a table into Oracle. However, I am getting the following error
(cx_Oracle.DatabaseError) ORA-01843: not a valid month [SQL: 'INSERT ... INTO
I tried to define the type of column for the date columns in the table
d_type_date = {c: types.DateTime for c in
data.columns[data.dtypes.isin(['datetime64[ns]', '<M8[ns]'])].tolist()}
And then pass it as a parameter to_sql
self.final_data.to_sql(table
, con=connection
, schema=schema
, if_exists='append'
, index=False
, dtype=d_type_date)
But I am still getting the same error. I read that it might be NLS_DATE_FORMAT, but I am not sure how to overcome the issue