I have a data frame in R having 3 columns using sqlSave. I can easily create a table in an SQL database:
channel <- odbcConnect("JWPMICOMP") sqlSave(channel, dbdata, tablename = "ManagerNav", rownames = FALSE, append = TRUE, varTypes = c(DateNav = "datetime")) odbcClose(channel)
This data frame contains information about managers (Name, Nav and Date) that are updated every day with new values ββfor the current date, and perhaps the old values ββcan be updated in case of errors.
How can I complete this task in R?
I try to use sqlUpdate, but it returns me the following error:
> sqlUpdate(channel, dbdata, tablename = "ManagerNav") Error in sqlUpdate(channel, dbdata, tablename = "ManagerNav") : cannot update 'ManagerNav' without unique column
source share