Error while inserting date column into oracle database using odbc package in R

, ,

I’ve had some trouble getting Oracle and odbc/DBI to play nicely with dates (as others have discussed here too Error when writing Date columns to Oracle DB via odbc).

My most recent solution, which is not very elegant, is to write dates as characters to a database table and then copy the table to a new table on the database while converting to an Oracle date variable. I wrap all this database copying and pasting in an R function that uses dbQuery() so I don’t have to think about it, but it’s not pretty.

Very much open to better solutions if they exist!

1 Like