DBI::dbAppendTable throws unused argument params error

14 Views Asked by At

I've been trying to use dbAppendTable but have not been able to get it to work.

library(DBI)
con <- dbConnect(RMySQL::MySQL(), dbname = "test", password = password)

dbCreateTable(con, "iris", iris)

df <- data.frame(Species = "rose")
dbAppendTable(con, "iris", df)

dbDisconnect(con)

This gives the error:

Error in .local(conn, statement, ...) :
  unused argument (params = list("rose"))

I get the same error if I use dbExecute with params like dbAppendTable:

DBI::dbExecute(con, "INSERT INTO iris (Species) VALUES (?)", params = list("rose"))

but not when I use dbExecute without params

 dbExecute(con, "INSERT INTO iris (Species) VALUES ('rose')")
0

There are 0 best solutions below