MATLAB DATABASE TOOLBOX RELEASE NOTES Guide de l'utilisateur Page 626

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 684
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 625
7 Functions — Alphabetical List
7-196
rollback
Undo database changes
Syntax
rollback(conn)
Description
rollback(conn) reverses changes made to a database using fastinsert, insert, or
update via the database connection conn. The rollback function reverses all changes
made since the last commit or rollback operation. To use rollback, the AutoCommit
flag for conn must be off.
Note: rollback does not roll back data in MySQL databases if the database engine is
not InnoDB.
Examples
1
Ensure that the AutoCommit flag for connection conn is off by running:
get(conn,'AutoCommit')
ans =
off
2
Insert data contained in exdata into the columns DEPTNO, DNAME, and LOC, in the
table DEPT, for the data source conn.
fastinsert(conn, 'DEPT',...
{'DEPTNO';'DNAME';'LOC'}, exdata)
3
Roll back the data that you inserted into the database by running:
rollback(conn)
The data in exdata is removed from the database. The database now contains the
data it had before you ran the fastinsert function.
Vue de la page 625
1 2 ... 621 622 623 624 625 626 627 628 629 630 631 ... 683 684

Commentaires sur ces manuels

Pas de commentaire