| odbc {RODBC} | R Documentation |
R functions which talk directly to the ODBC interface.
odbcTables(channel)
odbcColumns(channel, table)
odbcPrimaryKeys(channel, table)
odbcQuery(channel, query, rows_at_time = 1)
odbcFetchRows(channel, max = 0, buffsize = 1000, nullstring = NA,
believeNRows = TRUE)
channel |
connection handle as returned by
odbcConnect() of class "RODBC". |
query |
any valid SQL statement |
table |
a database table name accessible from the connected dsn. This can be either a character string or an (unquoted) symbol. |
rows_at_time |
The number of rows to fetch at a time, up to 1024. Not
all drivers work correctly with values > 1: see sqlQuery. |
max |
limit on the number of rows to fetch, with 0 indicating no limit. |
buffsize |
the number of records to be transferred at a time. |
nullstring |
character string to be used when reading SQL_NULL_DATA items
from the database.
|
believeNRows |
logical. Is the number of rows returned by the ODBC connection believable? Not true for Oracle, apparently. |
odbcFetchRows returns a data frame of the pending
rowset in $data limited to max rows if
max is greater than 0. buffsize may be increased from the
default of 1000 rows for increased performance in a large dataset.
This only has an effect with servers that do not return the number of rows
affected by a query e.g. MS Access, MS SQLServer.
Most return 1 on success and -1 on failure,
indicating that a message is waiting for odbcGetErrMsg.
odbcFetchRows may return -2 indicating "No Data",
the message that would be returned by odbcGetErrMsg.
Michael Lapsley and Brian Ripley
sqlQuery, odbcConnect,
odbcGetErrMsg.