[R] RODBC, freetds, and MS SQL Server

Prof. Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 1 08:52:05 CEST 2003


?odbcConnect has

believeNRows: logical.  Is the number of rows returned by the ODBC
          connection believable?  Not true for Oracle, apparently.

Try setting it to FALSE, as it looks like your driver is broken.

I am not wure why people keep ignoring this parameter in RODBC ....


On Mon, 31 Mar 2003, Andrew Schuh wrote:

> I have a question for RODBC users out there.  I have used the package with 
> good results for some time.  However, I have just switched from an OpenLink 
> proprietary driver for MS SQL to the FreeTDS driver (I think it is MS SQL 
> Server 2000 I'm connecting to if it matters).  I was/am running them from 
> unixODBC on a Linux Client.  I think I have it set up fine since I can use 
> "isql" to perform simple queries on the database.  However, I get really odd 
> behavior when I try to use it through RODBC.  It seems to connect fine but 
> gives back odd results.  The database I'm accessing is called "cmp" and there 
> are many tables of which one is called "Medium".  In the past "select * from 
> cmp.Medium" has returned the whole table to me but now it only seems like I 
> get column headers.  Any help or advice would be appreciated.
> 
> ##-------------------------------------------------------------------------------##
> > library(RODBC)
> > con <- odbcConnect("BIGSKY","***","**********")
> > con
> RODB Connection 0
> Details:
>   case=nochange
>   0À¨¦àÒ¨¦àÒ× 
> > sqlTables(con)
> [1] TABLE_QUALIFIER TABLE_OWNER     TABLE_NAME      TABLE_TYPE     
> [5] REMARKS        
> <0 rows> (or 0-length row.names)
> > sqlQuery(con,"select * from Medium")
> [1] "[RODBC] ERROR: Could not SQLExecute"                                                                  
> [2] "S1000 1 [unixODBC] Msg 208, Level 16, State 1, Server BIGSKY, Line 
> 1\nInvalid object name 'Medium'.\n"
> > sqlQuery(con,"select * from cmp.Medium")
> [1] MediumKey Medium    IsSpecies
> <0 rows> (or 0-length row.names)
> > version
>          _
> platform i686-pc-linux-gnu
> arch     i686
> os       linux-gnu        
> system   i686, linux-gnu
> status                    
> major    1
> minor    6.2
> year     2003             
> month    01               
> day      10               
> language R                
> >
> 
> Also, I'm using the latest RODBC I got from CRAN yesterday.
> 
> 

-- 
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