I'm struggling with writing a date column to an Oracle database using DBI and odbc. Below is the error I get. I am able to write data frames with character and numeric columns without a problem.
I think the issue with the date column may relate to what odbc does do the data types for Oracle database connections: https://github.com/r-dbi/odbc/blob/1476b25a62314d912b680f0fb7ce2047dadbc5f3/R/DataTypes.R#L230
But it is a little outside my depth to figure out how to make this work. Does any have experience successfully writing to a date field to an Oracle DB using odbc and DBI?
My con
object below is an Oracle database connection, but I've omitted my connection specifications from the reprex.
DBI::dbGetInfo(con)$dbms.name
#> [1] "Oracle"
df <- data.frame(DATE = seq(as.Date("2019-01-01"), as.Date("2019-12-31"), by = 1))
DBI::dbWriteTable(con, "TEST_DATE", df, overwrite = TRUE)
#> Error in result_insert_dataframe(rs@ptr, values): nanodbc/nanodbc.cpp:1587: 22003: [Oracle][ODBC]Numeric value out of range.
Created on 2019-11-21 by the reprex package (v0.3.0)