Questions tagged [rodbc]

RODBC provides an ODBC database interface for R. The CRAN package provides access to any Open DataBase Connectivity (ODBC) accessible database.

RODBC is an package providing an interface to database sources supporting an ODBC interface. This is very widely available, and allows the same R code to access different database systems. RODBC runs on /, and , and almost all database systems provide support for . The supported systems include , , , , and .

Repositories

Vignettes

Other resources

Related tags

753 questions
61
votes
5 answers

SQL Server RODBC Connection

Does anyone have a connection string example for using RODBC and connecting to MS SQL Server 2005 or 2008. Thank you.
Brandon
  • 996
  • 2
  • 15
  • 19
53
votes
8 answers

How to connect R with Access database in 64-bit Window?

When I tried to connect R with Access database I get an error odbcConnectAccess is only usable with 32-bit Windows Does anyone has an idea how to solve this? library(RODBC) mdbConnect<-odbcConnectAccess("D:/SampleDB1/sampleDB1.mdb")
Chris
  • 1,128
  • 3
  • 11
  • 25
22
votes
2 answers

RODBC Temporary Table Issue when connecting to MS SQL Server

I am running R on unix and I am using the RODBC package to connect to MS SQL server. I can execute a query that returns results fine with the package, but if I use a temporary table somewhere in my SQL query, an empty string is returned to me. …
rlh2
  • 899
  • 1
  • 7
  • 15
22
votes
4 answers

How to stop a running query?

I use RODBC to send queries to an SQL-Server. Sometimes they take too much time to run, so I need to cancel them. Clicking the red "stop" button in RStudio yields this error message: R is not responding to your request to interrupt processing so to…
Scarabee
  • 4,907
  • 5
  • 25
  • 49
22
votes
4 answers

Pass R variable to RODBC's sqlQuery?

Is there any way to pass a variable defined within R to the sqlQuery function within the RODBC package? Specifically, I need to pass such a variable to either a scalar/table-valued function, a stored procedure, and/or perhaps the WHERE clause of a…
Ray
  • 2,811
  • 8
  • 29
  • 53
22
votes
3 answers

How to insert a dataframe into a SQL Server table?

I'm trying to upload a dataframe to a SQL Server table, I tried breaking it down to a simple SQL query string.. library(RODBC) con <- odbcDriverConnect("driver=SQL Server; server=database") df <- data.frame(a=1:10, b=10:1, c=11:20) values <-…
jenswirf
  • 6,057
  • 8
  • 41
  • 62
21
votes
5 answers

RODBC queries returning zero rows

Issue: RODBC (falsely) returning zero rows Situation: I'm using RODBC to connect to a DSN I created using a commercial DB's ODBC driver (OSI Soft's PI Historian Time Series DB, if you're curious). > library(RODBC) > piconn <- odbcConnect("PIRV",…
Tommy O'Dell
  • 6,553
  • 13
  • 51
  • 67
20
votes
4 answers

Installation of RODBC/ROracle packages on OS X Mavericks

I have been trying to install some packages such as RODBC, ROracle or RGtk2 - used for rattle. I would really appreciate it if someone could help me get around this problem so that I could use these applications on a Mac with mavericks and with…
runningbirds
  • 4,451
  • 9
  • 40
  • 73
20
votes
4 answers

RODBC odbcDriverConnect() Connection Error

I'm trying to use odbcDriverConnect('driver={SQL Server};server=servername\instancename,port;database=testing;username=abc;password=123456') to connect remote database server (sql server 2008). But I got [RODBC] ERROR: state 08001, code 17,…
lijie98
  • 597
  • 1
  • 5
  • 13
17
votes
2 answers

R: Painfully slow read performance using RODBC & SQL Server

I am new to R but am interested in using Shiny to create dynamic charts using data stored in a SQL Server database. To enable interactivity, I want to bring in the raw data from the database and perform calculations within R rather than have the…
Jayhawk
  • 173
  • 1
  • 1
  • 6
17
votes
6 answers

Failure to connect to odbc database in R

I've been trying to connect my company's DMS to R using the odbcConnect command, but get the following message: myConn <-odbcConnect("NZSQL", uid="cejacobson", pwd="password") Warning messages: 1: In…
cjacobso
  • 329
  • 2
  • 4
  • 12
17
votes
4 answers

RODBC not recognizing my odbc settings

I'm running R 2.15.2 on a Red Hat Linux 6 server. My goal is to connect to a MS SQL Server Database on another machine via RODBC. I did my research and downloaded and installed the linux version of the MS SQL ODBC driver from the microsoft support…
vergilcw
  • 1,963
  • 4
  • 13
  • 20
13
votes
1 answer

sqlSave: Mapping dataframe timestamps to SQL Server timestamps

I am trying to upload a data frame to a table in sql server using sqlSave(). This dataframe has a timestamp in it and I'd like to map the timestamp col to a datetime col in sqlserver. I am getting two problems. 1. It maps the data frame's timestamp…
Angelo
  • 3,445
  • 3
  • 25
  • 39
13
votes
8 answers

RODBC loses time values of datetime when result set is large

So this is VERY strange. RODBC seems to drop the time portion of DateTime SQL columns if the result set is large enough. (The queries are running against an SQL Server 2012 machine, and, yes, when I run them on the SQL Server side they produce…
jbeldock
  • 1,985
  • 3
  • 15
  • 27
13
votes
4 answers

String continuation across multiple lines, no newline characters

Am using the RODBC library to bring data into R. I have a long query that I want to pass a variable to, much like this SO user. Problem is that R interprets the whitespace/carriage returns in my query as a newline '\n'. The accepted solution for…
Andrew
  • 8,441
  • 8
  • 41
  • 57
1
2 3
50 51