[R] rmysql fetch issues

From: Albert Vilella <avilella_at_gmail.com>
Date: Tue, 21 Apr 2009 13:27:58 +0100

I am trying to fetch data using RMySQL fetch method with n=100 in this loop:

lquery = paste(query," limit 10")
input = dbGetQuery(con1,lquery)
res = dbSendQuery(con1,query)
completed = FALSE
count = 0
while (completed != TRUE) {
  count = count + 1
  batch = fetch(res, n = 100)
  print (paste("batch",count))
  input = merge(input,batch,all=TRUE)
  print (paste("merge",count))
  completed = dbHasCompleted(res)

But after a while, I get this error:


[1] "batch 211"
[1] "merge 211"
[1] "batch 212"

Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) :   invalid 'times' value
In addition: Warning messages:
1: In mysqlFetch(res, n, ...) :
  RS-DBI driver warning: (error while fetching rows) 2: In mysqlFetch(res, n, ...) :
  RS-DBI driver warning: (error while fetching rows)

What could be causing this? Is there any other way to do this?

        [[alternative HTML version deleted]]

R-help_at_r-project.org 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 Tue 21 Apr 2009 - 11:31:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 21 Apr 2009 - 12:30:38 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.

list of date sections of archive