what is your con? (how have you made it ?)
and what is your first error ?
At first glance I think you are mixing up connecting to a database, with querying the connection.
look at an example from the documentation for DBI.
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbWriteTable(con, "mtcars", mtcars)
dbGetQuery(con, "SELECT * FROM mtcars")
dbGetQuery(con, "SELECT * FROM mtcars", n = 6)
# Pass values using the param argument:
# (This query runs eight times, once for each different
# parameter. The resulting rows are combined into a single
# data frame.)
dbGetQuery(
con,
"SELECT COUNT(*) FROM mtcars WHERE cyl = ?",
params = list(1:8)
)
dbDisconnect(con)