Description Usage Arguments Value Examples
is used to switch the data from the normal auto-commiting mode into transactional mode. Here, changes to the database will not be permanent until dbCommit
is called. If the changes are not to be kept around, you can use dbRollback
to undo all the changes since dbTransaction
was called.
1 2 | ## S4 method for signature 'MonetDBConnection'
dbTransaction(conn, ...)
|
conn |
A MonetDB.R database connection, created using |
TRUE if the transaction was successful
1 2 3 4 5 6 7 8 | conn <- dbConnect(MonetDB.R(), "monetdb://localhost/acs")
dbSendUpdate(conn, "CREATE TABLE foo(a INT,b VARCHAR(100))")
dbTransaction(conn)
dbSendUpdate(conn, "INSERT INTO foo VALUES(?,?)", 42, "bar")
dbCommit(conn)
dbTransaction(conn)
dbSendUpdate(conn, "INSERT INTO foo VALUES(?,?)", 43, "bar")
dbRollback(conn)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.