Open jfontestad opened 7 years ago
Ho w do you use it ? can you give more context ? From the error message you are trying to access a closed reader, that means that the connection object is closed.
can you test this code for example:
conn <- get_connection()
dbWriteTable(con, "T_MTCARS", mtcars[1:5, ])
query <- "SELECT * FROM T_MTCARS"
res <- dbSendQuery(conn, query)
df1 <- fetch(res,as.integer(floor(nrow(mtcars)/2)))
dbHasCompleted(res)
Hello, I was just using the default example that is attached with the DBI package.
res <- dbSendQuery(con, "SELECT * FROM mtcars WHERE cyl = 4") while(!dbHasCompleted(res)){ chunk <- dbFetch(res, n = 5) print(nrow(chunk)) }
What is con?
that's what i was using at the time as my connection variable.