Skip to content

Data frame with column name "sep" cause error #336

@fproske

Description

@fproske

When a data frame includes a column name "sep", any library that relies on the method "sqlAppendTable" (DBI/R/table-insert.R) will throw an error.

Reprex (with RSQLite package):

library(RSQLite)
a <- data.frame(sep = c(1,2,3))
con <- dbConnect(SQLite())
dbWriteTable(con, "a", a)
#> Error in (function (..., sep = " ", collapse = NULL) : formal argument "sep" matched by multiple actual arguments

Created on 2020-04-02 by the reprex package (v0.3.0)

The problem is here. One solution would be:

rows <- do.call(paste, c(unname(sql_values), sep = ", "))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions