I'm using GLUE package to make a search on my DB (Oracle), and it works very well when I put the value directly into the code, like above:
...
where
pla.cod_pedido = '0000545461' <--------------
and pla.cod_item = '000010' <-------------
and pla.cod_ordem_producao = ro.cod_ordem_producao
BUT, when i change this value to a numeric INPUT, like:
...
where
pla.cod_pedido = {as.numeric(input$pedido)} <--------------
and pla.cod_item = {as.numeric(input$item)} <-------------
and pla.cod_ordem_producao = ro.cod_ordem_producao
It does not work. I'm using the same values for both of the input's.
I think i can be a syntax error, but i don't have sure.
In the hard coded query you are using text values i.e. '0000545461' but in the other query you use as.numeric() this would give 54546 do you see the difference? Classes just don't match.
So for using character data as input I need use what type of input?
Because I'm testing:
SERVER
...
where
pla.cod_pedido = {(input$pedido)} <--------------
and pla.cod_item = {(input$item)} <-------------
and pla.cod_ordem_producao = ro.cod_ordem_producao
It's hard to know without a Reproducible Example,
but Im guessing that input$pedido returns a value without the leading zeros like '54546' and since you are comparing to a character string obviously they don't match, you could use stringr::str_pad() to add the leading zeros.