Database Toolbox | ![]() ![]() |
Syntax
rollback(conn)
Description
rollback(conn)
reverses changes made via insert
or update
to the database connection conn
. The rollback function reverses all changes made since the last commit
or rollback
, or the last exec
that performed a commit
or rollback
. The AutoCommit
flag for conn
must be off
to use rollback
.
Examples
Ensure the AutoCommit
flag for connection conn
is off
by typing
get(conn,'AutoCommit')
ans = off
Insert the data contained in exdata
into the columns DEPTNO
, DNAME
, and LOC
, in the table DEPT
, for the data source conn
. Type
insert(conn, 'DEPT', {'DEPTNO';'DNAME';'LOC'}, exdata)
Roll back the data inserted in the database by typing
rollback(conn)
The data in exdata
is removed from the database so the database contains the same data it did before the insert
.
See Also
commit
, database
, exec
, get
, insert
, update
![]() | resultset | rows | ![]() |