R/DBI.R
dbExecute-DatabaseConnectorConnection-character-method.Rd
Executes a statement and returns the number of rows affected.
dbExecute()
comes with a default implementation
(which should work with most backends) that calls
dbSendStatement()
, then dbGetRowsAffected()
, ensuring that
the result is always free-d by dbClearResult()
.
For passing query parameters, see dbBind()
, in particular
the "The command execution flow" section.
# S4 method for DatabaseConnectorConnection,character
dbExecute(conn, statement, translate = TRUE, ...)
A DBIConnection object, as returned by
dbConnect()
.
a character string containing SQL.
Translate the query using SqlRender?
Other parameters passed on to methods.
dbExecute()
always returns a
scalar
numeric
that specifies the number of rows affected
by the statement.
You can also use dbExecute()
to call a stored procedure
that performs data manipulation or other actions that do not return a result set.
To execute a stored procedure that returns a result set,
or a data manipulation query that also returns a result set
such as INSERT INTO ... RETURNING ...
, use dbGetQuery()
instead.
For queries: dbSendQuery()
and dbGetQuery()
.
Other DBIConnection generics:
DBIConnection-class
,
dbAppendTable()
,
dbCreateTable()
,
dbDataType()
,
dbDisconnect()
,
dbExistsTable()
,
dbGetException()
,
dbGetInfo()
,
dbGetQuery()
,
dbIsReadOnly()
,
dbIsValid()
,
dbListFields()
,
dbListObjects()
,
dbListResults()
,
dbListTables()
,
dbReadTable()
,
dbRemoveTable()
,
dbSendQuery()
,
dbSendStatement()
,
dbWriteTable()