Last chance! 50% off unlimited learning
Sale ends in
fetch(res, n, ...)
DBIResult
).
This object needs to be the result of a statement that produces
output, such as SQL's SELECT
or SELECT
-like statement,
this object res
is tyn = -1
to retrieve all pending records.
Some implementations may recognize other special values.DBI.pdf
in the base directory of this package
or dbConnect
,
dbSendQuery
,
dbGetQuery
,
dbClearResult
,
dbCommit
,
dbGetInfo
,
dbReadTable
.# Run an SQL statement by creating first a resultSet object
drv <- dbDriver("ODBC")
con <- dbConnect(drv, ...)
res <- dbSendQuery(con, statement = paste(
"SELECT w.laser_id, w.wavelength, p.cut_off",
"FROM WL w, PURGE P",
"WHERE w.laser_id = p.laser_id",
"ORDER BY w.laser_id"))
# we now fetch the first 100 records from the restulSet into a data.frame
data1 <- fetch(res, n = 100)
dim(data)
dbHasCompleted(res)
# let's get all remaining records
data2 <- fetch(res, n = -1)
Run the code above in your browser using DataLab