dbGetRowCount
From DBI v0.5-1
by Kirill Müller
The number of rows fetched so far
This value is increased by calls to dbFetch
. For a data
modifying query, the return value is 0.
Usage
dbGetRowCount(res, ...)
Arguments
- res
- An object inheriting from
DBIResult
. - ...
- Other arguments passed on to methods.
Value
-
a numeric vector of length 1
See Also
Other DBIResult generics: DBIResult-class
,
SQL
, dbBind
,
dbClearResult
, dbColumnInfo
,
dbFetch
, dbGetInfo
,
dbGetRowsAffected
,
dbGetStatement
,
dbHasCompleted
, dbIsValid
Examples
library(DBI)
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbWriteTable(con, "mtcars", mtcars)
rs <- dbSendQuery(con, "SELECT * FROM mtcars")
dbGetRowCount(rs)
ret1 <- dbFetch(rs, 10)
dbGetRowCount(rs)
ret2 <- dbFetch(rs)
dbGetRowCount(rs)
nrow(ret1) + nrow(ret2)
dbClearResult(rs)
dbDisconnect(con)
Community examples
Looks like there are no examples yet.