r-dbi Questions

12

I continue to read the DBI/ODBC is faster than RODBC, so I tried as follows: require(DBI);require(odbc) con <- DBI::dbConnect(odbc::odbc(), dsn = 'SQLSERVER1', database = 'AcumaticaDB') I can...
Disorientate asked 9/7, 2017 at 21:23

4

Solved

Occasionally when connecting to my Oracle database through ROracle and dbplyr I will run a dplyr::collect operation that fetches more data than expected and than R can handle. This can make R cras...
Collywobbles asked 3/11, 2017 at 14:2

3

Solved

With RODBC, there were functions like sqlUpdate(channel, dat, ...) that allowed you pass dat = data.frame(...) instead of having to construct your own SQL string. However, with R's DBI, all I see ...
Middleman asked 12/12, 2013 at 14:42

2

Solved

I want to insert data in MySQL from a dataframe in R. I managed to connect without problems from R to MySQL using dbConnect, however when I try to insert my data using dbWriteTable I keep getting t...
Subdeacon asked 8/11, 2016 at 6:23

2

I try to do a simple connect to an Oracle database via DBI and ROracle package following instructions from R to Oracle Database Connectivity: Use ROracle for both Performance and Scalability. When...
Disloyal asked 5/1, 2018 at 13:17

2

Solved

I recently installed MySQL on my computer and am trying to connect RStudio to MySQL. I followed instructions in a book as well as instructions here. However, whenever I use dbConnect() or src_mysql...
Arable asked 8/1, 2019 at 21:7

2

Solved

I have an API built with R plumber that connects to a PostgreSQL database using RPostgreSQL and pool (although this would also apply if I was using a Shiny app): # create the connection pool pool ...
Porte asked 4/3, 2019 at 18:0

2

Solved

I can use the following code in R to select distinct rows in any generic SQL database. I'd use dplyr::distinct() but it's not supported in SQL syntax. Anyways, this does indeed work: dbGetQuery(da...
Cytologist asked 30/12, 2019 at 22:19

1

Solved

library(tidyverse) con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") copy_to(con, mtcars) mtcars2 <- tbl(con, "mtcars") I can create this mock SQL database above. And it's very cool that...
Aixlachapelle asked 6/12, 2019 at 17:19

0

I have a data.frame that I am trying to append to a table in a PostgreSQL database in R using the DBI package. library(DBI) library(RPostgreSQL) mydrv <- dbDriver(drvName = "PostgreSQL") mydbc...
Uniseptate asked 19/11, 2019 at 18:26

0

The problem I want to write a wrapper around some DBI functions that allows safe execution of parameterized queries. I've found the this resource that explains how to use the glue package to inser...
Meemeece asked 16/5, 2019 at 9:22

2

Solved

By default when I use dbGetQuery() from the DBI package it returns columns of type integer64 as the integer64 class of the bit64. I then use dplyr to try and filter and manipulate my results but ...
Fanchon asked 18/7, 2017 at 15:54

1

We are moving away from RODBC which seems to have a limited error handling system (sometimes to query goes through even though there was an error, and there is no way to get the error message. we h...
Domitian asked 30/1, 2018 at 8:1

1

Solved

I'm building a package for internal usage and attempting to abstract away all possible database interaction from the users. I need to connect to the database and disconnect from the database within...
Judicative asked 6/7, 2018 at 15:49

1

Solved

I want to add a column to my table using ALTER TABLE and UPDATE statements not to recreate the full table. When using a subquery in my UPDATE statement I don't get the output I expect. build repr...
Galactose asked 18/6, 2018 at 14:48

1

Solved

Here is mtcars data in the MonetDBLite database file. library(MonetDBLite) library(tidyverse) library(DBI) dbdir <- getwd() con <- dbConnect(MonetDBLite::MonetDBLite(), dbdir) dbWriteTable...
Trudytrue asked 8/6, 2018 at 18:59

2

Solved

The Issue When trying to write to a table with a non-default schema, dbWriteTable in the package DBI, writes to default.non-default.tablename rather than writing to non-default.tablename. I know th...
Resound asked 27/7, 2017 at 16:5

1

Solved

I have very simple problem that produces error. Example will clear this one. library(odbc) library(DBI) library(dplyr) library(dbplyr) con <- dbConnect(odbc(), "myDSN") tbl_test <- tibble(...
Lutist asked 1/4, 2018 at 11:35

1

I have extracted data to a temporary table in SQL Server using DBI::dbGetQuery. Even though, in the real query (not the play query below), I select convert(date, date_value) as date_value, the d...
Moffett asked 7/2, 2018 at 0:21

1

Solved

I wrote a function using dbListTables from the DBI package, that throws a warning that I cannot understand. When I run the same code outside of a function, I don't get the warning message. For inf...
Hemicycle asked 13/10, 2017 at 11:6

1

I'm trying to append a dataframe to a sql server table using: DBI::dbWriteTable(con_poc, "DEP_EVENTS", data_up, overwrite=FALSE, append = TRUE, verbose = TRUE, rownames = FALSE) But I am getting...
Ignacia asked 7/7, 2017 at 12:41

2

Solved

My R workflow now involves dealing with a lot of queries (RPostgreSQL library). I really want to make code easy to maintain and manage in the future. I started loading large queries from separate ...
Masterful asked 13/4, 2017 at 6:33

1

Solved

I need to update column values conditionnaly on other columns in some PostgreSQL database table. I managed to do it writing an SQL statement in R and executing it with dbExecute from DBI package. ...
Williamswilliamsburg asked 17/7, 2017 at 16:15

1

Solved

I realize that dbGetQuery comes with a default implementation that calls dbSendQuery, then dbFetch, ensuring that the result is always freed by dbClearResult. and dbClearResult frees all resou...
Cowan asked 3/7, 2017 at 18:54

3

I have a project with a connection that was working properly on the same device. I suddenly got the error below. And I could connect from the same device through MySQL workbench. What could be the...
Massingill asked 28/3, 2017 at 15:31

© 2022 - 2024 — McMap. All rights reserved.