dbSendQuery-methods | R Documentation |
These methods are straight-forward implementations of the corresponding generic functions. However, for complex data like array are just transferred as a string instead of the corresponding vector in R. This behavior will change in future releases, and the author is advised not to rely on it.
an PostgreSQLConnection
object.
a character vector of length 1 with the SQL statement.
an PostgreSQLResult
object.
additional parameters.
See the Database Interface definition document
DBI.pdf
in the base directory of this package
or https://cran.r-project.org/package=DBI.
PostgreSQL
,
dbDriver
,
dbConnect
,
fetch
,
dbCommit
,
dbGetInfo
,
dbReadTable
.
## Not run:
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, "usr", "password", "dbname")
res <- dbSendQuery(con, "SELECT * from sales")
data <- fetch(res, n = -1)
# alternatively, use dbGetQuery
data <- dbGetQuery(con, "SELECT * from sales")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.