3. Statements : OpenROAD SQL Statements : Savepoint Statement : Examples—Savepoint Statement
 
Share this page                  
Examples—Savepoint Statement
The following example declares savepoints among other SQL statements:
insert into emp (name, sal, bdate)
        values ('Jones,Bill', 10000, 1945);
/*set first savepoint marker */
savepoint setone;
insert into emp (name, sal, bdate)
        values ('Smith,Stan', 20000, 1948);
/* set second savepoint marker */
savepoint 2;
insert into emp (name, sal, bdate)
        values ('Engel,Harry', 18000, 1954);
/* undo third append; first and second remain */
rollback to 2;
/* undoes second append; first remains */
rollback to setone;
commit;
/* only the first append is committed */