Description Usage Arguments Details Value Creation notes Author(s) Examples
Creates connection to ODBC database using the data contained in keyrings.
1 | connectODBC(databaseString = NULL)
|
databaseString |
Same as the service saved in the keyring. Default NULL will list the available keys prefixed with 'DB_' |
Keys should be set up prior to using the function to a style similar to:
keyring::key_set("DB_MARC_PRD.marcdl", username = "Driver={ODBC Driver 17 for SQL Server};Server=knights;Database=MARC_PRD;UID=marcdl;PWD=PASSWORD;")
Leave the PWD section in the username argument written as PASSWORD as this is
automatically replaced with the stored password when calling connectODBC()
OBDC connection object returned from DBI::dbConnect()
First created in 2020-Sept for easily accessing databases in R
Jacob Peterson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
library(glue)
library(magrittr)
library(DBI)
con <- connectODBC("DB_MARC_PRD.marcdl")
glue::glue("
SELECT *
FROM marcdl.VW_CovidCasesDeathsTestsLastUpdated
") %>%
DBI::dbGetQuery(con, .)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.