[R] dbplyr error updating database
Conklin, Mike (GfK)
Mike.Conklin at gfk.com
Mon Jul 17 18:20:28 CEST 2017
I am trying to use a shiny app to update records in an sqlite database. I keep running into the following error:
unable to find an inherited method for function 'dbSendQuery' for signature '"src_dbi", "character"'
The query I am trying to send is:
[1] "update kpquestions set mrisupercat = 'Demographics - Respondent' , set mricategory = 'Respondent - Age' , where VariableNumber = 2;"
Then I get this in my console window (and my browser connection to the locally running shiny app closes - although the app remains listening on the port)
Warning: Error in <Anonymous>: unable to find an inherited method for function 'dbSendQuery' for signature '"src_dbi", "character"'
Stack trace (innermost first):
67: <Anonymous>
66: dbSendQuery
65: observeEventHandler [/home/mconklin/tmpdir/CodeKPVars/server.R#76]
1: runApp
Auto-disconnecting SQLiteConnection
Auto-disconnecting SQLiteConnection
The specific chunk of server code being run is:
kpnew<-src_sqlite("/var/sqlite/KPProfile2")
stmnt<-paste0("update kpquestions set mrisupercat = '",input$supercat,"' , set mricategory = '",input$subcat, "' , where VariableNumber = ",input$vnum, ";")
print(stmnt)
dbSendQuery(kpnew,stmnt)
the print(stmnt) can be read above
sessionInfo() results
R version 3.4.0 (2017-04-21)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2 shinydashboard_0.6.1 labelled_1.0.0 haven_1.1.0
[5] tidyr_0.6.3 dplyr_0.7.1 dbplyr_1.1.0 readr_1.1.1
[9] shiny_1.0.3 RSQLite_2.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.11 bindr_0.1 magrittr_1.5 hms_0.3 bit_1.1-12
[6] xtable_1.8-2 R6_2.2.2 rlang_0.1.1 blob_1.1.0 tools_3.4.0
[11] DBI_0.7 htmltools_0.3.6 bit64_0.9-7 assertthat_0.2.0 digest_0.6.12
[16] tibble_1.3.3 memoise_1.1.0 glue_1.1.1 mime_0.5 compiler_3.4.0
[21] forcats_0.2.0 jsonlite_1.5 httpuv_1.3.5 pkgconfig_2.0.1
>
Any help would be appreciated
--
W. Michael Conklin
Executive Vice President
Marketing & Data Sciences - North America
GfK | 8401 Golden Valley Road | Minneapolis | MN | 55427
mike.conklin at gfk.com<mailto:mike.conklin at gfk.com>
T +1 763 417 4545 | M +1 612 567 8287
www.gfk.com<http://www.gfk.com/>
[[alternative HTML version deleted]]
More information about the R-help
mailing list