dbListFields-Odbc32Connection-character-method: List field names of a remote table

Description Usage Arguments Value Specification See Also Examples

Description

List field names of a remote table

Usage

1
2
## S4 method for signature 'Odbc32Connection,character'
dbListFields(conn, name, ...)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

name

a character string with the name of the remote table.

...

Other parameters passed on to methods.

column_name

The name of the column to return, the default returns all columns.

Value

dbListFields() returns a character vector that enumerates all fields in the table in the correct order. This also works for temporary tables if supported by the database. The returned names are suitable for quoting with dbQuoteIdentifier(). If the table does not exist, an error is raised. Invalid types for the name argument (e.g., character of length not equal to one, or numeric) lead to an error. An error is also raised when calling this method for a closed or invalid connection.

Specification

The name argument can be

A column named row_names is treated like any other column.

See Also

dbColumnInfo() to get the type of the fields.

Other DBIConnection generics: DBIConnection-class, dbAppendTable(), dbCreateTable(), dbDataType(), dbDisconnect(), dbExecute(), dbExistsTable(), dbGetException(), dbGetInfo(), dbGetQuery(), dbIsReadOnly(), dbIsValid(), dbListObjects(), dbListResults(), dbListTables(), dbReadTable(), dbRemoveTable(), dbSendQuery(), dbSendStatement(), dbWriteTable()

Examples

1
2
3
4
5
6
con <- dbConnect(RSQLite::SQLite(), ":memory:")

dbWriteTable(con, "mtcars", mtcars)
dbListFields(con, "mtcars")

dbDisconnect(con)

anderic1/odbc32 documentation built on Jan. 11, 2021, 12:24 a.m.