con <- DBI::dbConnect(dbDriver("SQLite"),"db_projektarbeit.sqlite")
rs <- DBI::dbSendQuery(con, "select * from Material_Master")
and i get the error message:
Error in result_create(conn@ptr, statement) :
no such table: Material_Master
and the table looks like:
cderv
June 8, 2019, 5:03pm
2
Did you try to specify the schema ?
rs <- DBI::dbSendQuery(con, "select * from Tabellen.Material_Master")
You may not be connected with the schema by default so it must be specified.
thank you but this didnt helped
ok, i started R studio again and now it works with the schema..
cderv
June 8, 2019, 5:19pm
5
You can try a DBI::dbListTables()
to see if the tables are seen by R.
As your table have an _
you may need to quote the SQL statement.
Usually I use dbplyr
and dplyr
to connect
library(DBI)
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbWriteTable(con, "mtcars", mtcars)
dbListTables(con)
#> [1] "mtcars"
library(dplyr, warn.conflicts = FALSE)
tab <- tbl(con, 'mtcars')
tab %>%
select(cyl)
#> # Source: lazy query [?? x 1]
#> # Database: sqlite 3.22.0 [:memory:]
#> cyl
#> <dbl>
#> 1 6
#> 2 6
#> 3 4
#> 4 6
#> 5 8
#> 6 6
#> 7 8
#> 8 4
#> 9 4
#> 10 6
#> # ... with more rows
Created on 2019-06-08 by the reprex package (v0.3.0.9000)
Using dbplyr::in_schema
when a shema is required.
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:
If your question has been answered, don't forget to mark the solution!
How do I mark a solution?
Find the reply you want to mark as the solution and look for the row of small gray icons at the bottom of that reply. Click the one that looks like a box with a checkmark in it:
[image]
Hovering over the mark solution button shows the label, "Select if this reply solves the problem". If you don't see the mark solution button, try clicking the three dots button ( ••• ) to expand the full set of options.
When a solution is chosen, the icon turns green and the hover label changes to: "Unselect if this reply no longer solves the problem". Success!
[solution_reply_author]
…
1 Like
system
Closed
June 29, 2019, 6:13pm
7
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.