Hello, Does anyone know a way to connect from R on Linux box to TeraData server? I can use ODBC connection on Windows box, but with amount of data I need (and prefer) to use large Linux box. Thanks, Vadim
On Wed, 17 Oct 2007, Vadim Kutsyy wrote:> Hello, > > Does anyone know a way to connect from R on Linux box to TeraData > server? I can use ODBC connection on Windows box, but with amount of > data I need (and prefer) to use large Linux box. >Well I am not sure about the TeraData server bit, but there is an ODBC driver for linux and I have used it to connect it quite successfully (thank you Brian) to access MySQL on a linux box from both Windows and Linux boxes. The installation of the ODBC driver on linux is described in the README file which is part of the RODBC package. David Scott _________________________________________________________________ David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 Auckland 1142, NEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email: d.scott at auckland.ac.nz Graduate Officer, Department of Statistics Director of Consulting, Department of Statistics
Vadim Kutsyy wrote:> > > Does anyone know a way to connect from R on Linux box to TeraData > server? I can use ODBC connection on Windows box, but with amount of > data I need (and prefer) to use large Linux box. > > Thanks, > Vadim > >You indicate that the ODBC connection to Teradata on Windows is working for you. This may be a newbie question, but I'm not getting beyond an apparently successful connection to the Teradata...> odbcGetInfo(odw)DBMS_Name DBMS_Ver Driver_ODBC_Ver "Teradata" "06.02.0205 V2R" "03.52" Data_Source_Name Driver_Name Driver_Ver "ODW" "TDATA32.DLL" " 3.05.00.04" ODBC_Ver Server_Name "03.52.0000" "********"> getSqlTypeInfo()double integer character logical MySQL double integer varchar(255) varchar(5) ACCESS DOUBLE INTEGER VARCHAR(255) varchar(5) Microsoft.SQL.Server float int varchar(255) varchar(5) PostgreSQL float8 int4 varchar(255) varchar(5) Oracle double precision integer varchar(255) varchar(255) SQLite double integer varchar(255) varchar(5) EXCEL NUMBER NUMBER VARCHAR(255) LOGICAL DBASE Numeric Numeric Char(254) Logical> getSqlTypeInfo("TDATA32.DLL")NULL> odw_driver <- odbcGetInfo(odw) > getSqlTypeInfo(odw_driver)Error in typesR2DBMS[[driver]] : no such index at level 1> sqlTables(odw)Error in iconv(data[[i]], from = enc) : invalid 'from' argument In addition: Warning message: closing unused RODBC handle 1> sqlQuery(odw,"select top 10 * from odw_prs_v.pool")Error in iconv(query, to = enc) : invalid 'to' argument Apparently there are some data conversion errors... do data types need to be established first? Any other ideas what's missing? Thanks, Warren. -- View this message in context: http://www.nabble.com/R-and-TeraData-tf4642728.html#a14160501 Sent from the R help mailing list archive at Nabble.com.
I think that your first step should be to read the documentation of whatever software you are using here (you didn't say). You are getting iconv errors because you set an invalid encoding. You haven't shown us all the steps you used, and in one of those not shown you will find your error. If you don't understand what they are needed for, at least at first accept the default arguments for things like encodings. You will find people more willing to help you if you give them credit for their work: you are using a contributed package here without giving *any* credit, not even its name. On Tue, 4 Dec 2007, Warren Van Camp wrote:> > > Vadim Kutsyy wrote: >> >> >> Does anyone know a way to connect from R on Linux box to TeraData >> server? I can use ODBC connection on Windows box, but with amount of >> data I need (and prefer) to use large Linux box. >> >> Thanks, >> Vadim >> >> > > You indicate that the ODBC connection to Teradata on Windows is working for > you. This may be a newbie question, but I'm not getting beyond an > apparently successful connection to the Teradata... > >> odbcGetInfo(odw) > DBMS_Name DBMS_Ver Driver_ODBC_Ver > "Teradata" "06.02.0205 V2R" "03.52" > Data_Source_Name Driver_Name Driver_Ver > "ODW" "TDATA32.DLL" " 3.05.00.04" > ODBC_Ver Server_Name > "03.52.0000" "********" >> getSqlTypeInfo() > double integer character logical > MySQL double integer varchar(255) varchar(5) > ACCESS DOUBLE INTEGER VARCHAR(255) varchar(5) > Microsoft.SQL.Server float int varchar(255) varchar(5) > PostgreSQL float8 int4 varchar(255) varchar(5) > Oracle double precision integer varchar(255) varchar(255) > SQLite double integer varchar(255) varchar(5) > EXCEL NUMBER NUMBER VARCHAR(255) LOGICAL > DBASE Numeric Numeric Char(254) Logical > >> getSqlTypeInfo("TDATA32.DLL") > NULL > >> odw_driver <- odbcGetInfo(odw) >> getSqlTypeInfo(odw_driver) > Error in typesR2DBMS[[driver]] : no such index at level 1 > >> sqlTables(odw) > Error in iconv(data[[i]], from = enc) : invalid 'from' argument > In addition: Warning message: > closing unused RODBC handle 1 > >> sqlQuery(odw,"select top 10 * from odw_prs_v.pool") > Error in iconv(query, to = enc) : invalid 'to' argument > > > Apparently there are some data conversion errors... do data types need to be > established first? Any other ideas what's missing? > > Thanks, > Warren. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595