This method is a straight-forward implementation of the corresponding generic function.
# S4 method for OraResult
fetch(res, n = -1, ...)
an OraResult
object.
maximum number of records to retrieve per fetch.
Use n = -1
to retrieve all pending records.
currently unused.
number of records fetched from database.
The ROracle
implementations retrieves only n
records,
and if n
is missing it returns all records.
For the Oracle Database documentaion see http://www.oracle.com/technetwork/indexes/documentation/index.html.
Oracle
,
dbConnect
,
dbSendQuery
,
dbGetQuery
,
dbClearResult
,
dbCommit
,
dbGetInfo
,
dbReadTable
.
# NOT RUN { # } # NOT RUN { drv <- dbDriver("Oracle") con <- dbConnect(drv, "scott", "tiger") res <- dbSendQuery(con, "select * from emp") # we now fetch the first 10 records from the resultSet into a data.frame data1 <- fetch(res, n = 10) dim(data1) dbHasCompleted(res) # let's get all remaining records data2 <- fetch(res, n = -1) # }
Run the code above in your browser using DataCamp Workspace