commit {RMySQL}R Documentation

RDBMS Transaction Management

Description

Commit/rollback SQL transactions

Usage

commit(con, ...)

rollback(con, ...)

Arguments

con a dbConnection object, as produced by the function dbConnect.
... any database-specific arguments.

Details

Not all database engines implement transaction management, MySQL, for instance.

Value

NULL

Side Effects

The current transaction on the connections con is committed or rolled back.

References

See The Omega Project for Statistical Computing (http://www.omegahat.org) for more details on the R/S database interface.

See Also

On database managers:

dbManager MySQL load unload

On connections, SQL statements and resultSets:

dbExecStatement dbExec fetch quickSQL

On transaction management:

commit rollback

On meta-data:

describe getVersion getDatabases getTables getFields getCurrentDatabase getTableIndices getException getStatement hasCompleted getRowCount getAffectedRows getNullOk getInfo

Examples

ora <- Oracle()
con <- dbConnect(ora)
rs <- dbExecStatement(con, 
      "delete * from PURGE as p where p.wavelength<0.03")
if(rowsAffected(rs) > 250){
  warning("dubious deletion -- rolling back transaction")
  rollback(con)
}


[Package Contents]