DBI (version 0.5-1)

dbColumnInfo: Information about result types

Description

Produces a data.frame that describes the output of a query. The data.frame should have as many rows as there are output fields in the result set, and each column in the data.frame should describe an aspect of the result set field (field name, type, etc.)

Usage

dbColumnInfo(res, ...)

Arguments

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

Value

A data.frame with one row per output field in res. Methods MUST include name, field.type (the SQL type), and data.type (the R data type) columns, and MAY contain other database specific information like scale and precision or whether the field can store NULLs.

See Also

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

Examples

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

rs <- dbSendQuery(con, "SELECT 1 AS a, 2 AS b")
dbColumnInfo(rs)
dbFetch(rs)

dbClearResult(rs)
dbDisconnect(con)

Run the code above in your browser using DataCamp Workspace