Can access database from R command prompt
"select Employment from OES_2002 where Occupation like 'Computer programmer%'" > rs=dbSendQuery(db,q) > df=fetch(rs,n=-1) > df Employment 1 457320
But below shiny app throws the error shown at bottom
server.R
output$summary <-renderPrint({ #connect to the Database db=dbConnect(SQLite(),dbname="MyTest.sqlite"); q=myQueryBuilder("OES_2002",input$jf,input$job); rs=dbSendQuery(db,q); df=fetch(rs,n=-1); #y=do.call(getYData,args=list(db,input$jf,input$job)) print(df); dbDisconnect(db); })
RS-DBI driver: (error in statement: no such table: OES_2002)
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/-8S9PKeXLNw/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to shiny-discus...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/-8S9PKeXLNw/unsubscribe.
Error in sqliteSendQuery(con, statement, bind.data) :
error in statement: no such table: TblResult
My Code:
#OPEN LIBRARIES
library("shiny") #SHINY LIBRARY
library("RSQLite") #SQLITE LIBRARY
library("DBI")
#SET CONNECTION TO EXISTING SQLITE DATABASE
sqlite <- dbDriver("SQLite") #LOAD DRIVER
candb <- dbConnect(sqlite, dbname= "WaterQuality_STEP_V8.sqlite") #LOAD DB
#IMPORT ALL DISTINCT CONSTITUENT NAMES FROM DATABASE
AllCanConst <- data.frame(dbGetQuery(candb, "SELECT DISTINCT TblResult.Constituent_ID FROM TblResult ORDER BY TblResult.Cons tituent_ID"))
ListAllCanConst <- AllCanConst[,1] #SELECTS THE FIRST COLUMN ONLY
#DISCONNECT WITH SQLITE DATABASE
dbDisconnect(candb)
Can anyone tell me what's wrong with the code?
It is possible to use SQLite database within the shiny web framework right?