0

I am attempting to connect to an Oracle database, extract my data and put it into a flat file on R. The table has ~ 16 million rows with 25 columns. There are many strings in some of these columns. I am using the RODBC and ETLUtils package in R.

Here is my code:

    test<-read.odbc.ffdf(query="select * from meta", 
    odbcConnect.args=list(dsn="XX", uid="xxxxxxxxxxxxxx", pwd="xxxxxxxxxxxxxxx"),
    test=test,VERBOSE=TRUE)

After I run this I am getting the following error:

        read.odbc.ffdf 1.. ()  odbc-read=0sec
Error in if (nrow(dat) == 0) { : argument is of length zero

I'm not sure how to get around this.

SniperBro2000
  • 113
  • 1
  • 5
  • What is this test argument? There is no test argument when looking at the help of ?read.odbc.ffdf You might also want to check if a connection works using ?odbcConnect before trying out read.odbc.ffdf –  Oct 09 '14 at 16:42
  • The test argument is the name of the optional ff object to append records to. If I remove test=test argument I get the same error. Here is another example of my code: x<-read.odbc.ffdf(query="select * from meta", odbcConnect.args=list(dsn="DXX",uid="XXXXXXXXX", pwd="XXXXXXXXX"),VERBOSE=TRUE) – SniperBro2000 Oct 09 '14 at 16:48
  • What does require(RODBC); odbcConnect(dsn="DXX",uid="XXXXXXXXX", pwd="XXXXXXXXX") give you? –  Oct 14 '14 at 07:28
  • That is how I connect to my database. I use the rODBC package and the odbcConnect function with my DSN, user id and password. – SniperBro2000 Oct 16 '14 at 18:22
  • Yes, and does that work or does it give an error? –  Oct 16 '14 at 18:24
  • It works. I'm capable of extracting and analyzing data from the database using a query that looks like this: sqlQuery(database, "select * from table"). – SniperBro2000 Oct 16 '14 at 19:21
  • And does sqlQuery(database, "select * from meta") return records or does it return 0 records. –  Oct 16 '14 at 20:28

0 Answers0