dbListFields,OdbcConnection,character-method | R Documentation |
List field names of a remote table
## S4 method for signature 'OdbcConnection,character' dbListFields( conn, name, catalog_name = NULL, schema_name = NULL, column_name = NULL, ... )
conn |
A DBIConnection object, as returned by
|
name |
a character string with the name of the remote table. |
catalog_name |
The name of the catalog to return, the default returns all catalogs. |
schema_name |
The name of the schema to return, the default returns all schemas. |
column_name |
The name of the column to return, the default returns all columns. |
... |
Other parameters passed on to methods. |
%
can be used as a wildcard in any of the search parameters to
match 0 or more characters. _
can be used to match any single character.
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.
The name
argument can be
a string
the return value of dbQuoteIdentifier()
a value from the table
column from the return value of
dbListObjects()
where is_prefix
is FALSE
A column named row_names
is treated like any other column.
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()
con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) dbListFields(con, "mtcars") dbDisconnect(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.