teradataR package and R 3.0.0

Analytics
Fan

teradataR package and R 3.0.0

Hi All,

I am new to Teradata and trying to get my connection from R to work... I am running R 3.0.0 and installing the package through 

install.packages("~/Downloads/teradataR_1.0.1.zip", repos = NULL)

throws a warning that package ‘~/Downloads/teradataR_1.0.1.zip’ is not available (for R version 3.0.0)

What are the compatible R versions for teradataR? The documentation PDF mentions R 2.11 and later

Are there any plans to release teradataR for R3.0.0?

Tags (1)
23 REPLIES
Teradata Employee

Re: teradataR package and R 3.0.0

It will work on any version >= 2.11 and < 3.0.0.

Supporter

Re: teradataR package and R 3.0.0

I know - but why doesn't TD release a new version? 

Or release the source code as open source and someone could move this forward?

Teradata Employee

Re: teradataR package and R 3.0.0

I have a similar issue with the latest RODBC 1.3-6.     It states that it was build under R 3.0.0.   The RODBC archive has RODBC_1.3-5.tar.gz.   I'm hopeful that once gunzip'ed it will install.

Enthusiast

Re: teradataR package and R 3.0.0

Yes Teradata, please support R by updating the package or releasing the source code.

Re: teradataR package and R 3.0.0

I experienced the issue with TeraData ODBC not working with R version 3.0, but started using R 3.0 and RStudio 3.0.1 because it's a better environment.  Figured I would find a way to connect them or revert the R once the code was developed.

I combined a couple of posts and this is what just worked on my windows 7 laptop.  I also have TeraData Studio open with an active connection to the same database, so that may have something to do with R version 3.0.1 using RODBC and successfully querying TeraData v14.  This is an initial post, as I will investigate the connectivity with more complex queries in the coming days.

library(RODBC)
odbcDataSources()

# dBASE Files
# "Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)"
#...
# TestData
# "Teradata"

channel <- odbcDriverConnect("dsn=testData;uid=user;pwd=password;")

sqlStr <- "select top 5 qty_sold from DataBase.Table ;"

sqlQuery(channel, sqlStr, believeNRows = FALSE);

# qty_sold
#1 0
#2 12
#3 1
#4 1
#5 3

Re: teradataR package and R 3.0.0

I discovered that R v3.0.1 (2013-05-16) and RStudio 0.97.551 (which uses R v3.01 packages) both communicate via RODBC with TeraData v14on a Windows 7 PC if you have TeraData Studio open and logged in.  The SQL shown below works in both R applications, as does a SQL query that is 8 pages long in Word.

NOTE: THE SQL COMMANDS CANNOT CONTAIN ANY TAB CHARACTERS. (Tab characters are automatically removed during execution, so white space between words can be lost and the SQL command fails.)

STEP 1:  Install TeraData Studio, open it and log into the TeraData system.

STEP 2: Perform the following steps in an updated [R] application (RStudio has a great UI - try it!)

library(RODBC)
odbcDataSources()

# dBASE Files
# "Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)"
#...
# TestData
# "Teradata"

# Use the connection labeled "Teradata" along with you userID and password
channel <- odbcDriverConnect("dsn=TestData;uid=userID;pwd=password;")

#Change the quesry to communicate with your database and table(s).
sqlStr <- "select top 5 qty_sold from DataBase.Table ;"

sqlQuery(channel, sqlStr, believeNRows = FALSE);

# qty_sold
#1 0
#2 12
#3 1
#4 1
#5 3

Re: teradataR package and R 3.0.0

I'm also trying to sort this out.  I wonder if the success DouglasM reports is due to his R code referencing RODBC functions rather than TeradataR functions.  That is, success with odbcDriverConnect() is showing that RODBC works, while success with tdConnect() would show that TeradataR is working.  Right? 

I'm forced to put all this in the form of a question as I have yet to be successful getting RODBC to recognize my (64-bit) connections.  Studio and SQL-A connect just fine.  Sigh.

Re: teradataR package and R 3.0.0

+1 Please update this package.

Re: teradataR package and R 3.0.0

Please update this package for R version 3.0.

Thank you