Note the ‘table’ includes whatever table-like objects are
provided by the DBMS, in particular views and system tables.
sqlFetch
by default retrieves the the entire contents of the table
sqtable
. Rownames and column names are restored as indicated
(assuming that they have been placed in the table by the corresponding
arguments to sqlSave
).
Alternatively, sqlFetch
can fetch the first max
rows, in
which case sqlFetchMore
will retrieve further result rows,
provided there has been no other ODBC query on that channel in the
meantime.
These functions try to cope with the peculiar way the Excel ODBC
driver handles table names, and to quote Access table names which
contain spaces. Dotted table names, e.g. myschema.mytable
, are
allowed on systems that support them, unless the connection was opened
with interpretDot = FALSE
.
Useful additional parameters to pass to sqlQuery
or
sqlGetResults
include
max
:limit on the number of rows to fetch, with
0
(the default) indicating no limit.
nullstring
:character string to be used when reading
SQL_NULL_DATA
character items from the database:
default NA_character_
.
na.strings
:character string(s) to be mapped to
NA
when reading character data: default "NA"
.
as.is
:as in sqlGetResults
.
dec
:The character for the decimal place to be assumed
when converting character columns to numeric.
rows_at_time
:Allow for multiple rows to be retrieved at
once. See sqlQuery
.