Low-level ODBC functions
R functions which talk directly to the ODBC interface.
odbcTables(channel, catalog = NULL, schema = NULL, tableName = NULL, tableType = NULL, literal = FALSE)
odbcQuery(channel, query, rows_at_time = attr(channel, "rows_at_time")) odbcFetchRows(channel, max = 0, buffsize = 1000, nullstring = NA_character_, believeNRows = TRUE)
connection handle as returned by
odbcConnect, of class
- catalog, schema, tableName, tableType
NULLor character: whether these do anything depends on the ODBC driver. The first three can be length-one character vectors, and
tableTypecan specify zero or more types.
logical: should arguments be interpreted literally or including wildcards?
any valid SQL statement.
The number of rows to fetch at a time, between 1 and 1024. Not all drivers work correctly with values > 1: see
limit on the number of rows to fetch, with 0 indicating no limit.
the number of records to be transferred at a time.
character string to be used when reading
SQL_NULL_DATAitems in a column transferred as character.
logical. Is the number of rows returned by the ODBC connection believable?
odbcTables enquires about the tables on the connected database.
Whether arguments after the first do anything and what they do
depends on the ODBC driver: see the help on
for some driver-specific details.
odbcFetchRows returns a data frame of the pending rowset,
max rows if
max is greater than 0.
buffsize may be increased from the default of 1000 rows for
increased performance on a large dataset. This only has an effect
max = 0 and
believeNRows = FALSE (either for the
ODBC connection or for this function call), in which case
buffsize is used as the initial allocation length of the R
vectors to hold the results. (Values of less than 100 are increased
to 100.) If the initial size is too small the vector length is
doubled, repeatedly if necessary.
odbcGetErrMsg returns a (possibly zero-length)
character vector of pending messages.
odbcClearError returns nothing, invisibly.
The otheres return
1 on success and
-1 on failure,
indicating that a message is waiting to be retrieved
odbcFetchRows may return
"No Data", the message that would be