search for: sqlfetch

Displaying 20 results from an estimated 180 matches for "sqlfetch".

2002 Aug 28
1
RODBC: sqlFetch and its argument sqtable
Calling function "sqlFetch" in library(RODBC) and specifying a character string as 2nd argument, I get an error I don't understand: library(RODBC) channel <- odbcConnect("mydatabase.mdb", case="msaccess") sqlFetch(channel, "mytable") # this works fine tabname <- "mytable&quo...
2004 Nov 09
1
colnames argument in sqlFetch backwards? (PR#7355)
Full_Name: Bert Gunter Version: 2.0.0 patched OS: Win2000 Submission from: (NULL) (192.12.78.250) The TRUE/FALSE options of the colnames argument in sqlFetch (RODBC) seem to be reversed, at least for .xls files. ## z is a connection to an xls workbook opened by odbcConnectExcel() > dat<-sqlFetch(z,'SuccessRates',colnames=FALSE) > dat[1:5,] RecID Name Run Grams Lost Run (80L) 1 NA Activase 117 839.91 0 2 NA Ac...
2012 Oct 30
1
sqlFetch doesn't read the whole objects.
Hi everyone, I connected a data in FileMaker server with odbcConnect. When I call the data "CANCERS" using sqlFetch, it looks okay. However, the number of obs was different with the actual number. If I read the same data from Microsoft Access, there are 656 obs. in it but srt() shows me 600 obs. Does anyone know why this happened and how to read all obs. from R? Thank you in advance. EJ > psb<-odbcCo...
2002 May 11
2
RODBC sqlFetch
...to use RODBC and odbcConnect. Now works nicely. The question I've got now is: noms <- list.files(pattern=".DBF") # removing extension names: noms <- sapply(noms, function(x) as.character(strsplit(x,".DBF")) , USE.NAMES=F) for (i in 1:length(noms)) { s <- sqlFetch(bdades, noms[i]) # etc. } But it seems that sqlFetch() doesn't accept the name noms[i]. Neither paste(noms[1], sep = ""). Any suggestion for workaround? Thanks in advance Juli -- Juli G. Pausas Centro de Estudios Ambientales del Mediterraneo (CEAM) C/ C.R. Darwin 14, Parc Tecnolog...
2007 Jan 16
1
RODBC: sqlQuery is successful, but a similar sqlFetch returns error
...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 d...
2012 Feb 24
1
looping over string of frames when importing with 'sqlFetch' from a Microsoft Access database
Dear R-list, I am trying to import (all) frames from a Microsoft Access database as individual data frames in a fancy loop, but I'm having troubles figuring out how to use the 'sqlFetch' from the RODBS package in a loop (mostly because I can't figure out how to loop over elements (I came from stata) I would very much appreciate if anyone on the list could help me solve this problem, as it is an issue of connecting to a database I can't really make a working example, p...
2005 Oct 10
3
sqlFetch on MySQL-DB
Dear all, I successfully set up a local MySQL-database. Connecting via RODBC is not problem, the same in fetching 3 of 4 tables. But trying to connect to table 4 fails. > author<-sqlFetch(test,"author") Error in fromchar(unclass(x)) : character string is not in a standard unambiguous format In principle I understand that error message, but I don't know any solution. Thanks for any help, Bernd > version _ platform i386-pc-m...
2008 Jun 26
1
RODBC, sqlFetch error when accessing Excel
This is about R 2.7.0 and related packages on windows NT. I have a mixture of numeric and character data and empty cells in an Excel spreadsheet with several tabs that I'm trying to read with sqlFetch from RODBC. The data that is returned by sqlFetch is unfortunately not identical to the source data in that in columns with character values in the first few rows the subsequent rows of that column which are filled with numeric values are not returned properly but set to <NA>. Specifing as.is...
2004 Nov 09
1
RODBC bug or doc error in sqlFetch on xls files (PR#7354)
R 2.0.0 patched under win2000. MS Office Excel 2003. ODBC Drivers? This may not come as a surprise -- sqlFetch() (and perhaps other ?) appear not to handle table/worksheet names with spaces in them in Excel tables. I was not able to find documentation that specifically mentioned this, although the Help pages vaguely hinted that there might be difficulty with Excel's "peculiar handling" of tabl...
2011 Mar 03
1
sqlFetch (RODBC) question
Dear all, I've used RODBC a lot to read in files created in MS excel and access but found a strange problem today: a variable in my data file contained both numbers and text; sqlFetch would set text within a row of numbers to NA; but if first 5 or 6 rows would be text then all numbers would be read in as NA. con<-odbcConnectExcel("xample.xls") #the file is attached or at http://psych.ut.ee/~nek/ajutine/xample.xls sqlFetch(con, "TT$") # ID_NO Setting...
2012 May 19
2
Loading the stupid dataset--help!!!
I am using the following: library(RODBC) chan = odbcConnectExcel("rats-lda") rats.lda = sqlFetch(chan, "data") close(chan) And getting the following error message: > library(RODBC) Error in library(RODBC) : there is no package called ?RODBC? > chan = odbcConnectExcel("rats-lda") Error: could not find function "odbcConnectExcel" > rats.lda = sqlFetch(cha...
2009 Aug 14
1
RODBC does not like table names >11/12 characters
...using RODBC, but since last week I am not able anymore to fetch any table which has a name longer than 11 or 12 characters. Here is the the pattern of my code, nothing spectacular: library(RODBC) channel2<-odbcDriverConnect('DSN=xxx') #table names with up to 11 characters still work sqlFetch(channel2, 'abcdefghijk') #table names with 13 or more characters do not sqlFetch(channel2, 'abcdefghijklm') Fehler in odbcTableExists(channel, sqtable) : ?abcdefghijklm?: table not found on channel I do not have any tables with 12 character names, to check where exactly the bor...
2013 Apr 03
1
sqlSave writes, but only for sqlFetch
...bL<http://pastebin.com/W6UGKep9>, I connect to a Netezza instance, make a simple table, and query it. Despite sqlSave succeeding without error, sqlQuery tells me the table doesn't exist. Also, when I query the database outside of R, I see that the table doesn't exist. However, using sqlFetch works, and (perhaps, as expected) the table is dropped upon evaluating close(myConn). Also, sqlDrop works as expected. Thanks for your time. Any thoughts are appreciated. Dave Mitchell [[alternative HTML version deleted]]
2009 Nov 18
3
Re ading multiple Excel 2007 files with a loop
...following example code using R 2.10.0 on a computer running Windows (XP, I think): library(RODBC) channel <- odbcDriverConnect("DRIVER=Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb); DBQ=U:\\test folder\\testA.xlsx; ReadOnly=False") sqlTables(channel) my.data.A <- sqlFetch(channel, "Sheet1") odbcClose(channel) channel <- odbcDriverConnect("DRIVER=Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb); DBQ=U:\\test folder\\testB.xlsx; ReadOnly=False") sqlTables(channel) my.data.B <- sqlFetch(channel, "Sheet1") odbcClose(cha...
2007 Mar 06
2
Package RODBC
...(RODBC) # required for those who want to repeat these lines 1st, I noticed that the following sequence does not work: channel <- odbcConnextExcel("test.xls") tables <- sqlTables(channel) name1 <- tables[1, "TABLE_NAME"] # this should be the name plan1 <- sqlFetch(channel, name1) # bang! odbcClose(channel) However, I can circumvent this with: channel <- odbcConnextExcel("test.xls") tables <- sqlTables(channel) name1 <- tables[1, "TABLE_NAME"] # this should be the name plan1 <- sqlQuery(channel, sprintf("sel...
2011 Jun 14
0
sqlFetch and factor conversion
R users, Hello, I used sqlFetch to import a data table from MS Access 2007 and I set as.is = TRUE to prevent character vectors from becoming factors. However, I can't figure out how to prevent the $ operator from being added by sqlFetch to the end of each character vector(e.g. TD$ and SITE$). This causes subsequent parts of...
2013 Jul 16
2
Importing data by odbcConnectExcel in 64 bit
I have probably an old question. I have R.3.0.1 installed in 64 bit windows 7. The odbcConnectExcel in RODBC library does not work. Tried odbcConnectExcel2007 still does not work. Any ideas. Thanks Melissa<-sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"),sqtable = "Sheet3", + na.strings = "NA", as.is = TRUE) Error in sqlFetch(odbcConnectExcel2007("F:\\Cotton2012\\validation.xlsx"), : first argument is not an open RODBC channel In a...
2006 Jul 06
1
as.data.frame question
I'm using the RODBC library to read in an Excel file using the odbcConnectExcel function. I can read the Excel data prefectly, however all my character variables get converted to factors when using my.data <- as.data.frame(sqlFetch(channel, "Sheet1")) I've tried using my.data <- as.data.frame(I(sqlFetch(channel, "Sheet1"))) but this creates just one column of data. Is there an efficient way to read in the character variables from my Excel data as characters rather than converting them...
2013 Apr 02
0
sqlFetch works but sqlQuery doesn't
...e at http://pastebin.com/W6UGKep9, I connect to a Netezza instance, make a simple table, and query it. Despite sqlSave succeeding without error, sqlQuery tells me that the table doesn't exist. Also, when I query the database outside of R, I see that the table doesn't exist. However, using sqlFetch works, and (perhaps, as expected) the table is dropped upon evaluating close(myConn). Also, sqlDrop works as expected. Thanks for your time. Any thoughts are appreciated. Dave Mitchell [[alternative HTML version deleted]]
2002 May 30
2
RODBC & Problems with Sybase Database
Hello, i would like import Data from Sybase DataBase to R-1.5.0 via RODBC. With this i get a connection without problems ! channel <- odbcConnect("ODBCName","LoginName","LoginPass") dataSybase <- sqlFetch(channel,"EPORT_XYZ") ,but when i try this i get a message error ? (Perhaps the _ is a problem, i know that's i.e. not usual to name objects with _ in R ?) Error in odbcFetchRows(channel, max = max, transposing = (as != "matrix"), : negative length vectors are not allo...