[R] R and TeraData

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Dec 7 15:24:18 CET 2007


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



More information about the R-help mailing list