Dear Joe,
I'm trying to create an Shiny-App which can suck in new Oracle data.
Unfortunately it does not work and I do not know where my mistake lies.
Here is my mini example:
## ui.R
library(shiny)
library(ROracle)
library(ggplot2)
shinyUI(fluidPage(
titlePanel("Prototyp Shiny"),
sidebarLayout(
sidebarPanel(
numericInput(
inputId = "anr",
label="Artikelnummer",
value=""
)
),
# Show a plot of the generated distribution
mainPanel(
dataTableOutput("anzk")
)
)
))
##Server.R
library(shiny)
library(ROracle)
library(ggplot2)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
art_re <- reactive({
drv <- dbDriver("Oracle")
con <- dbConnect(drv,username="**",password="**",dbname="**")
res <- dbSendQuery(con,paste0("select count(*) from kuart_mon where firma='00' and artnr=",input$anr,"and periode='201512'"))
art_res <- fetch(res)
dbDisconnect(con)
art_res})
renderTable({output$anzk <- art_re})
})
runApp('H:\\Profile\\Projekte\\Prototype_shiny\\app_1')
Thanks for your help.