Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(DBI)
- library(odbc)
- library(RPostgreSQL)
- # ODBC
- con <- dbConnect(odbc::odbc(), Driver = "postgresql", Server = cred[[1]], UID = cred[[2]],
- Database = cred[[3]], PWD = cred[[4]], Port = "5432")
- #RPostgreSQL
- con <- dbConnect(RPostgreSQL::PostgreSQL(), host = cred[[1]], user = cred[[2]],
- dbname = cred[[3]], password = cred[[4]])
- if (!dbExistsTable(con, "indianajones")) {
- dbWriteTable(con, "indianajones", data)
- }
Add Comment
Please, Sign In to add comment