dbCommit-methods
From DBI v0.1-10
by David James
DBMS Transaction Management
Commit/rollback SQL transactions
Usage
dbCommit(conn, ...)
dbRollback(conn, ...)
Arguments
- conn
- a
DBIConnection
object, as produced by the functiondbConnect
. - ...
- any database-specific arguments.
Details
Not all database engines implement transaction management, older versions of MySQL, for instance.
Value
- a logical indicating whether the operation succeeded or not.
Side Effects
The current transaction on the connections con
is committed or rolled back.
References
See the Database Interface definition document
DBI.pdf
in the base directory of this package
or
See Also
dbConnect
dbSendQuery
dbGetQuery
fetch
dbCommit
dbGetInfo
dbReadTable
Examples
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)
}
Community examples
Looks like there are no examples yet.