-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathdbFetch-DatabaseConnectorDbiResult-method.Rd
More file actions
71 lines (66 loc) · 2.5 KB
/
Copy pathdbFetch-DatabaseConnectorDbiResult-method.Rd
File metadata and controls
71 lines (66 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DBI.R
\name{dbFetch,DatabaseConnectorDbiResult-method}
\alias{dbFetch,DatabaseConnectorDbiResult-method}
\title{Fetch records from a previously executed query}
\usage{
\S4method{dbFetch}{DatabaseConnectorDbiResult}(res, n = -1, ...)
}
\arguments{
\item{res}{An object inheriting from \link[DBI:DBIResult-class]{DBIResult}, created by
\code{\link[DBI:dbSendQuery]{dbSendQuery()}}.}
\item{n}{maximum number of records to retrieve per fetch. Use \code{n = -1}
or \code{n = Inf}
to retrieve all pending records. Some implementations may recognize other
special values.}
\item{...}{Other arguments passed on to methods.}
}
\value{
\code{dbFetch()} always returns a \link{data.frame} with
as many rows as records were fetched and as many
columns as fields in the result set,
even if the result is a single value
or has one
or zero rows.
Passing \code{n = NA} is supported and returns an arbitrary number of rows (at least one)
as specified by the driver, but at most the remaining rows in the result set.
}
\description{
Fetch the next \code{n} elements (rows) from the result set and return them
as a data.frame.
\Sexpr[results=rd,stage=render]{DBI:::methods_as_rd("dbFetch")}
}
\details{
\code{fetch()} is provided for compatibility with older DBI clients - for all
new code you are strongly encouraged to use \code{dbFetch()}. The default
implementation for \code{dbFetch()} calls \code{fetch()} so that it is compatible with
existing code. Modern backends should implement for \code{dbFetch()} only.
}
\seealso{
Close the result set with \code{\link[DBI:dbClearResult]{dbClearResult()}} as soon as you
finish retrieving the records you want.
Other DBIResult generics:
\code{\link[DBI]{DBIResult-class}},
\code{\link[DBI]{dbBind}()},
\code{\link[DBI]{dbClearResult}()},
\code{\link[DBI]{dbColumnInfo}()},
\code{\link[DBI]{dbGetInfo}()},
\code{\link[DBI]{dbGetRowCount}()},
\code{\link[DBI]{dbGetRowsAffected}()},
\code{\link[DBI]{dbGetStatement}()},
\code{\link[DBI]{dbHasCompleted}()},
\code{\link[DBI]{dbIsReadOnly}()},
\code{\link[DBI]{dbIsValid}()},
\code{\link[DBI]{dbQuoteLiteral}()},
\code{\link[DBI]{dbQuoteString}()}
Other data retrieval generics:
\code{\link[DBI]{dbBind}()},
\code{\link[DBI]{dbClearResult}()},
\code{\link[DBI]{dbFetchArrow}()},
\code{\link[DBI]{dbFetchArrowChunk}()},
\code{\link[DBI]{dbGetQuery}()},
\code{\link[DBI]{dbGetQueryArrow}()},
\code{\link[DBI]{dbHasCompleted}()},
\code{\link[DBI]{dbSendQuery}()},
\code{\link[DBI]{dbSendQueryArrow}()}
}