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
0
votes
0 answers

Data import error with RODBC from Access

I am trying to import the results of a query performed on an access database into R. I can establish a connection using the RODBC package and I am able to retrieve records, so a connection with the database is not an issue. The problem is that two…
Josh W.
  • 1,043
  • 10
  • 15
0
votes
3 answers

Writing a formula into an excel file using RODBC

I am able to write a data frame to an excel file, using the RODBC package. Now I would like to include some formulas, e.g. =A1, which upon opening the excel file are interpreted as such; including "=A1" as text in the data frame results in a string…
mitchus
  • 3,732
  • 3
  • 26
  • 67
0
votes
1 answer

How to specify include and lib directories when locally installing RODBC?

i am trying to install RODBC with the commadn R CMD INSTALL -l /my/local/path RODBC.tar.gz and it wont find sql.h and sqlext.h ..how do i pass the include and lib paths to this command?
Palace Chan
  • 7,625
  • 5
  • 36
  • 83
0
votes
1 answer

RODBC - multiple tables in one sqlQuery() call

I'm using RODBC to pull data into R from an existing SQL database. I am trying to call multiple queries/tables at once. For example: test2=sqlQuery(channel,'select top 10 * from bug; select top 10 * from site') This only returns the first table. I…
-1
votes
2 answers

Error connecting to sql server with docker, rbase, and RODBC

I'm trying to access a SQL Server on a local intranet with R, where R is loaded in a docker file with R-base. On my desktop, I create a ODBC driver and it recognizes my windows credentials with the following: odbcDriverConnect('driver={SQL…
Frank
  • 391
  • 2
  • 10
-1
votes
1 answer

DataFrame Object not found error in R

I am trying to connect and MS Access database to R and create a dataframe and eventually plot some data, but I get this error, while it seems I am importing the data from a table correctly. Where is the problem? Console: > # Load RODBC package >…
Ibo
  • 3,351
  • 6
  • 33
  • 51
-1
votes
1 answer

Using R, return SQL results but not message from a stored proc

Is there a way to mute a print statement that occurs within a stored procedure, without editing the procedure? I run a SQL query using RODBC from with R. Other answers have addressed that SET NOCOUNT ON is often required in order to just return the…
conor
  • 874
  • 1
  • 11
  • 21
-1
votes
1 answer

How to Read 3 Million Records from RODBC and write to Text File

I'm reading 3 Million Records from a table and i want to Write it to a text file, but i'm facing as the program is running out of Memory throwing an error Exceeded maximum space of Memory 3096 MB. My System Configuration is i5 Processor with 4 GB…
-1
votes
1 answer

No package called rodbc

I am using R Studio where I have installed RODBC successfully as it works fine when I run a .r script. However, when I use the very same code in an .Rmd file I get an error saying Error in library("rodbc") : there is no package called 'rodbc' …
Pip
  • 43
  • 1
  • 4
-1
votes
1 answer

How to specify a destination DB while exporting data frame to mssql

I would like to export a data frame to mssql table.I used the code below but I would like to set the destination and not only the server and table name.I have a few DBs inside the server,how can i save the table in one of…
mql4beginner
  • 2,041
  • 5
  • 29
  • 63
-1
votes
2 answers

Filter and read dataset from SQL server into R

I have a large table in SQL server and would like to import into R with a WHERE clause on date. library(RODBC) dbhandle <- odbcDriverConnect('driver={SQL Server};server=mysqlhost;database=mydbname;trusted_connection=true') # Main table query works…
Prasanth
  • 43
  • 7
-1
votes
1 answer

Query data from Hana database with R, dealing with quotes

I use R to read data from a Hana database. Some of the table names include backslashes, which forces me to use quotation marks. I cannot read these tables using R. Let me show you an example ... This SQL works in Hana: SELECT COUNT(*) FROM…
Daniel
  • 1
-1
votes
3 answers

R- How to do a loop on a list and output different dataframes

I'm attempting to create a loop in R that will use a vector of dates, run them through a loop that includes a SQL query, and then generate a separate dataframe for each output. Here is as far as I've gotten: library(RODBC) dvect <-…
William
  • 156
  • 10
-1
votes
1 answer

Pivot a table in SQL vs pivot same data frame in R

I have a large data set around 3 columns and 600000 rows. After pivoting it will convert to 1000 columns and 600 rows. Subset of input data Date Id Price 2014/12/03 Id1 100 2014/12/03 Id2 120 2014/12/03 Id3 …
Chaturvedi Dewashish
  • 1,332
  • 2
  • 13
  • 38
-1
votes
2 answers

How can i do a query with SQLsave in R?

I have a question about SqlSave , I Know that sqlsave Writes a Data Frame to a Table in an ODBC Database , but i would like to write an insert query. How can i do that with Sqlsave ,can u give me an example ? Thank you
foboss
  • 300
  • 2
  • 12
1 2 3
50
51