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

802 questions
4
votes
0 answers

Connect to sql server database on linux with R

I'm trying to connect to a microsoft sql database through R on a VM with ubuntu 16.04 as the OS. I have installed DBI, RMySQL, RODBC and odbc packages. I can connect to an oracle database. Here is the command i tried using: con <-…
tonyk
  • 348
  • 5
  • 22
4
votes
2 answers

Connecting to a Redshift database from R

I want to connect to a database on Redshift and load a table to a data frame I have the following: Hostname (not JDBC URL) Username Password Table name Schema What packages should I use? I am looking for the right code if someone can help. Should…
4
votes
2 answers

R and odbcDriverConnect() to connect R to teradata

I am trying to connect R to Teradata and am not sure what the input items are to the RODBC::odbcDriverConnect(). There is a teradataR package, but it is only used with R versions 3 and under, which I neither have nor want to switch to. Below is a…
Tracy
  • 699
  • 2
  • 9
  • 21
4
votes
1 answer

How to insert data to SQL Server table using R?

I need help to write a simple data row to SQL server from R Language. (using RODBC or otherwise).
Saeedses
  • 109
  • 1
  • 1
  • 8
4
votes
3 answers

RODBCExt: sqlExecute issue with dates

I was trying to use parameters in a query but I (or my system) seems to have problem with dates. I'm connection to a MS SQL Server and define a specific date I want to handle endDate <- '02.08.2015' My query looks like this: test <-"SELECT…
Quickbeam2k1
  • 5,287
  • 2
  • 26
  • 42
4
votes
1 answer

sqlSave pads numeric/integer with space

I have some data which I am trying to upload to a table in a database. For example: df <- data.frame(name = c("Fred", "George", "David"), data = c(10, 100, 1000)) When I am using the RODBC::sqlSave function (with fast = FALSE to insert one row at a…
nathaneastwood
  • 3,664
  • 24
  • 41
4
votes
1 answer

RPostgreSQL - R Connection to Amazon Redshift - How to WRITE/Post Bigger Data Sets

I'm experimenting with how to connect R with Amazon's Redshift - and publishing a short blog for other newbies. Some good progress - I'm able to do most things (create tables, select data, and even sqlSave or dbSendQuery 'line by line' HOWEVER, I…
Ryan Anderson
  • 91
  • 1
  • 9
4
votes
0 answers

RODBC on an Oracle Database and special characters

Sorry if I ask a question that has already been ask, I effectively found some similar questions (like Special characters and RODBC for example) in this forum but no answer help me... So, my problem is that when I make a query on an Oracle database,…
Corabox
  • 157
  • 10
4
votes
1 answer

RODBC using Data.Frame in a Join on sqlQuery()

Is there a way to use a data.frame in JOIN condition using sqlQuery()? I'm connecting to SQL server using RODBC and need to limit the inital result set against a data.frame I've already got in R so it only returns 4000 records out of 200,000.…
Grant
  • 41
  • 3
4
votes
3 answers

Reading a access database (mdb) in 64 bit in R

I have a database and I need to read that in R. I found some packages such as Hmisc and RODBC which have the functions to do that. I am using windows and was not able to use Hmisc because you need to have mdb-tools package and I found no tutorial or…
Jd Baba
  • 5,948
  • 18
  • 62
  • 96
4
votes
2 answers

RODBC sqlSave crashes R front end

i am trying to write to an msaccess database using sqlSave from the RODBC package. i have no problems opening a connection to the database. i am able to read from tables. i can even make certain simple updates using sqlSave, but for the following…
4
votes
0 answers

Connect R to Sybase Database

Can anyone share how to connect to a Sybase database in R? I am doing this: con <- odbcConnect(dsn= "xxxxx", uid="xxxxx", pwd="xxxxx")#, rows_at_time = 500) data<-sqlQuery(con, "select * from test") data close(con) and I get the error: first…
user3022875
  • 8,598
  • 26
  • 103
  • 167
4
votes
3 answers

Is there a better way to code this sqlQuery in R?

I'm writing an R script to get some database data and then do stuff with it, using the RODBC package. Currently all my sqlQuery commands are one long string; stsample<-sqlQuery(odcon, paste"select * from bob.DESIGNSAMPLE T1, bob.DESIGNSUBJECTGROUP…
PaulHurleyuk
  • 8,009
  • 15
  • 54
  • 78
4
votes
1 answer

Using dplyr to connect to SSL-encrypted remote database

I would like to use the dplyr package in R but to connect to a remote database that is SSL-encrypted. How do I set up a workaround here? I'm thinking of setting up a backend that uses the RODBC package. Is this possible?
Brash Equilibrium
  • 1,357
  • 4
  • 14
  • 35
4
votes
0 answers

sqlSave in the RODBC writes line by line in the database

I am writing 250K rows with 6 columns (1 string, 2 Dates, 3 double) in a Oracle database via the function sqlSave in the package RODBC. The database is an Oracle 11, the Driver for the odbc Connection is the 11.02.00.03 Here is my code: ch <-…
ddg
  • 2,493
  • 2
  • 20
  • 23