[R] RODBC: sqlQuery is successful, but a similar sqlFetch returns error

From: Ben Fairbank <BEN_at_ssanet.com>
Date: Tue 16 Jan 2007 - 17:23:44 GMT

Greetings guRus --  

I have successfully queried a large (24,445 rows by 281 cols.) in-house database using the following RODBC query (without the line breaks)  

testout <- sqlQuery(channel, "select idSchedule,EXCL_Total from dbo.vwC1198_2006_RawData_With_CMPL_EXCL")  

This returns a dataframe of 24445 rows and two columns (as intended), but the following command  

testout <-
sqlFetch(channel,"dbo.vwC1198_2006_RawData_With_CMPL_EXCL",colnames = TRUE,rownames = "idSchedule")  

returns the error message  

in odbcTableExists(channel, sqtable) :

        'dbo.vwC1198_2006_RawData_With_CMPL_EXCL': table not found on channel  

The value of channel did not change between the two commands.  

Based on the help files for sqlFetch and sqlQuery, it is not clear to me why one command would find the table and the other would not. I am running R 2.4.1 on a Windows XP pro machine with 2 gig of memory.  

Thanks for any suggestions or hints,  

Ben Fairbank  

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed Jan 17 04:46:24 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 16 Jan 2007 - 18:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.