R: Result information

sqlite-meta {RSQLite} | R Documentation

## Result information

### Description

For a result object, returns information about the SQL statement used, the available columns and number of already fetched rows for a query, the number of affected rows for a statement, and the completion status.

### Usage

    ## S4 method for signature 'SQLiteResult'
    dbColumnInfo(res, ...)

    ## S4 method for signature 'SQLiteResult'
    dbGetRowsAffected(res, ...)

    ## S4 method for signature 'SQLiteResult'
    dbGetRowCount(res, ...)

    ## S4 method for signature 'SQLiteResult'
    dbHasCompleted(res, ...)

    ## S4 method for signature 'SQLiteResult'
    dbGetStatement(res, ...)

### Arguments

`res` | An object of class `SQLiteResult`
`...` | Ignored. Needed for compatibility with generic

### See Also

The corresponding generic functions `DBI::dbColumnInfo()`, `DBI::dbGetRowsAffected()`, `DBI::dbGetRowCount()`, `DBI::dbHasCompleted()`, and `DBI::dbGetStatement()`.

### Examples

    library(DBI)
    db <- RSQLite::datasetsDb()
    rs <- dbSendQuery(db, "SELECT * FROM USArrests WHERE UrbanPop >= 80")
    dbGetStatement(rs)
    dbColumnInfo(rs)
    dbHasCompleted(rs)
    dbGetRowCount(rs)

    dbFetch(rs, n = 2)
    dbHasCompleted(rs)
    dbGetRowCount(rs)

    invisible(dbFetch(rs))
    dbHasCompleted(rs)
    dbGetRowCount(rs)
    dbClearResult(rs)

    dbDisconnect(db)

    con <- dbConnect(RSQLite::SQLite(), ":memory:")
    dbExecute(con, "CREATE TABLE test (a INTEGER)")
    rs <- dbSendStatement(con, "INSERT INTO test VALUES (:a)", list(a = 1:3))
    dbGetRowsAffected(rs)
    dbClearResult(rs)
    dbDisconnect(con)

[Package RSQLite version 1.1-2 Index]