Database Toolbox Previous page   Next Page
rollback

Undo database changes

Syntax

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

MATLAB returns

Insert the data contained in exdata into the columns DEPTNO, DNAME, and LOC, in the table DEPT, for the data source conn. Type

Roll back the data inserted in the database by typing

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


Previous page  resultset rows Next page

© 1994-2005 The MathWorks, Inc.