Examples for business, study, careers, love, and more...
Examples :: MYSQL Examples :: Example of Savepoint and Rollback To Savepoint Mysql Statement

Example of Savepoint and Rollback To Savepoint Mysql Statement:

SAVEPOINT A ON ROLLBACK RETAIN CURSORS;

Create Table test (id integer);
Commit;
Insert Into test values (1);
Commit;
Insert Into test values (2);
Savepoint y;
Delete from test;
Select * from test;
Rollback to y;
Select * from test;
Rollback;
Select * from test;


Example of Mysql Savepoint and Rollback To Savepoint


SAVEPOINT identifier
ROLLBACK [WORK] TO [SAVEPOINT] identifier
RELEASE SAVEPOINT identifier