Sql Statements Must Be Issued with dbExecute() or dbSendStatement() Instead of dbGetQuery() or dbSendQuery()
I Would Like to Create a New Database, Which Returns the Results of a Query as a Dataframe. If I Use dbExecute() or dbSendStatement(), as Indicated in the...
I would like to create a new database, which returns the results of a query as a dataframe. If I use dbExecute() or dbSendStatement(), as indicated in the warning message, it won't return the required dataframe. What can I do to remove this warning? Why am I getting these warnings?
drv <- RSQLite::dbDriver("SQLite")
con <- DBI::dbConnect(drv, dbname= tempfile())
DBI::dbGetQuery(con, paste("CREATE TABLE activity",
"(aid INTEGER, cid INTEGER,",
"activity INTEGER, score REAL)"))
# data frame with 0 columns and 0 rows
# Warning message:
# In result_fetch(res@ptr, n = n) :
# SQL statements must be issued with dbExecute() or dbSendStatement() instead of dbGetQuery() or dbSendQuery().
Thank you very much! :)