dbCommit {DBI} | R Documentation |
Commit/rollback SQL transactions
dbCommit(conn, ...) dbRollback(conn, ...)
conn |
a DBIConnection object, as produced by the function
dbConnect .
|
... |
any database-specific arguments. |
Not all database engines implement transaction management, older versions of MySQL, for instance.
a logical indicating whether the operation succeeded or not.
The current transaction on the connections con
is committed or rolled back.
See the Database Interface definition document
DBI.pdf
in the base directory of this package
or
http://developer.r-project.org/db.
dbConnect
dbSendQuery
dbGetQuery
fetch
dbCommit
dbGetInfo
dbReadTable
## Not run: ora <- dbDriver("Oracle") con <- dbConnect(ora) rs <- dbSendQuery(con, "delete * from PURGE as p where p.wavelength<0.03") if(dbGetInfo(rs, what = "rowsAffected") > 250){ warning("dubious deletion -- rolling back transaction") dbRollback(con) } ## End(Not run)