Commits or roll backs the current transaction in an Oracle connection
# S4 method for OraConnection
dbCommit(conn, ...)
# S4 method for OraConnection
dbRollback(conn, ...)
a OraConnection
object, as produced by the function dbConnect
currently unused.
saves changes permanently.
undo all changes done after last save point.
implementation saves all changes done on that connection. Changes can not be undone once saved permanently.
implementation undo all chnages done after last savepoint.
For the Oracle Database documentaion see http://www.oracle.com/technetwork/indexes/documentation/index.html.
Oracle
,
dbConnect
,
dbSendQuery
,
dbGetQuery
,
fetch
,
dbCommit
,
dbGetInfo
,
dbReadTable
.
# NOT RUN { # } # NOT RUN { drv <- dbDriver("Oracle") con <- dbConnect(drv, "scott", "tiger") dbReadTable(con, "EMP") rs <- dbSendQuery(con, "delete from emp where deptno = 10") dbReadTable(con, "EMP") if(dbGetInfo(rs, what = "rowsAffected") > 1) { warning("dubious deletion -- rolling back transaction") dbRollback(con) } dbReadTable(con, "EMP") # }
Run the code above in your browser using DataCamp Workspace