[R] trouble with RODBC -- chopping off part of column names

Marc Schwartz marc_schwartz at me.com
Sat Oct 2 15:31:45 CEST 2010

On Oct 1, 2010, at 6:26 PM, Mike Williamson wrote:

> Hello all,
>    I have a strange / interesting problem that might be 'R' settings
> themselves, or it might be something with the OS.
>    I am using the RODBC library.  I have a script that goes out and, before
> making a query for a big data set, will first query for the column names of
> the data set.  The column names could sometimes be quite long (e.g., "Time
> Background Estimation (seconds)" ).  If I make this query for the column
> names from my Windows laptop or from a Windows server, using odbcConnect() &
> sqlQuery(), I get the column names properly.  However, if I run this via
> unix, it will chop off part of the column name.  (E.g., with "Time
> Background Estimation (seconds)", it becomes "Time Background Estimation
> (se", which is 30 characters long.)
>    Does anyone have a clue what might be causing this (settings in 'R',
> something within unix, etc.)?  I am not even sure how to debug, and I can't
> really get around this because I cannot simply query all of the columns, the
> data set would become too large.
>                                                  Thanks!
>                                                          Mike


You indicated 'unix' above. Is that Solaris or are you being generic in a reference to a Linux platform?

We need the details of your OS, the version of R you are running and whether it is 32 or 64 bit, as well as the database that you are connecting to (eg. Oracle).

You can use:


from the R command line to bring up a PDF carefully written by Prof. Ripley, that contains additional details the use of RODBC and some OS/DB specific documentation for the package.

For further details on how we can better help you, see the R Posting Guide:


Lastly, for future reference, there is an R-SIG-DB list:


Marc Schwartz

More information about the R-help mailing list