transactions {DBI} | R Documentation |
Not all database engines implement transaction management, in which case
these methods should not be implemented for the specific
DBIConnection
subclass.
Not all database engines implement transaction management, in which case
these methods should not be implemented for the specific
DBIConnection
subclass.
dbBegin(conn, ...) dbCommit(conn, ...) dbRollback(conn, ...) dbBegin(conn, ...) dbCommit(conn, ...) dbRollback(conn, ...)
conn |
A |
... |
Other parameters passed on to methods. |
a logical indicating whether the operation succeeded or not.
a logical indicating whether the operation succeeded or not.
The current transaction on the connections con
is committed or rolled
back.
The current transaction on the connections con
is committed or rolled
back.
## 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) ## 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)