Learn R Programming

DBI (version 0.5-1)

dbHasCompleted: Completion status

Description

This method returns if the operation has completed. A SELECT query is completed if all rows have been fetched. A data manipulation statement is completed if it has been executed.

Usage

dbHasCompleted(res, ...)

Arguments

res
An object inheriting from DBIResult.
...
Other arguments passed on to methods.

Value

a logical vector of length 1

See Also

Other DBIResult generics: DBIResult-class, SQL, dbBind, dbClearResult, dbColumnInfo, dbFetch, dbGetInfo, dbGetRowCount, dbGetRowsAffected, dbGetStatement, dbIsValid

Examples

Run this code
con <- dbConnect(RSQLite::SQLite(), ":memory:")

dbWriteTable(con, "mtcars", mtcars)
rs <- dbSendQuery(con, "SELECT * FROM mtcars")

dbHasCompleted(rs)
ret1 <- dbFetch(rs, 10)
dbHasCompleted(rs)
ret2 <- dbFetch(rs)
dbHasCompleted(rs)

dbClearResult(rs)
dbDisconnect(con)

Run the code above in your browser using DataLab