execute {rocker} | R Documentation |
Execute SQL statement in database. Combination of functions execute and clearResult. If required, database is automatically connected and disconnected.
Description
Execute SQL statement in database. Combination of functions execute and clearResult. If required, database is automatically connected and disconnected.
Usage
execute(db, statement, ...)
Arguments
db |
rocker object |
statement |
SQL statement ( |
... |
Optional, additional suitable parameters passed to |
Value
Number of affected rows
See Also
Other rocker-S3-functions:
appendTable()
,
begin()
,
canConnect()
,
clearResult()
,
columnInfo()
,
commit()
,
connect()
,
createTable()
,
disconnect()
,
existsTable()
,
fetch()
,
getInfoCon()
,
getInfoDrv()
,
getInfoRes()
,
getQuery()
,
getRowCount()
,
getRowsAffected()
,
getStatement()
,
hasCompleted()
,
isValidCon()
,
isValidDrv()
,
isValidRes()
,
listFields()
,
listObjects()
,
listTables()
,
readTable()
,
removeTable()
,
rocker-README
,
rocker-S3-functions
,
rocker-package
,
rollback()
,
sendQuery()
,
sendStatement()
,
setupDriver()
,
setupMariaDB()
,
setupPostgreSQL()
,
setupSQLite()
,
unloadDriver()
,
validateCon()
,
writeTable()
Examples
db <- rocker::newDB()
rocker::setupSQLite(db)
rocker::connect(db)
rocker::writeTable(db, "mtcars", mtcars)
rocker::execute(db, "DELETE FROM mtcars WHERE gear = 3;")
rocker::disconnect(db)
rocker::unloadDriver(db)