首页 > 解决方案 > 警告消息:在 dbFetch(rs, n = n, ...) 中:获取行时出错

问题描述

我正在使用 R 从 MySql 获取数据并Warning message: In dbFetch(rs, n = n, ...) : error while fetching rows出现错误。我需要了解如何批量获取数据以避免此类错误。

我的代码:

Df<-

ColId       Range
IOP-22      232
IOP-23      234

其中 datafrme 包含约 20000 个条目,并传递ColId给 MySql 查询:

get_dt<-paste0("select ColId,col1, col2, col3 from mytable where ColId IN (", paste(shQuote(Df$ColId , type = "sh"),
                                                     collapse = ', '), ");")

标签: rdataframedplyrtidyversermysql

解决方案


推荐阅读