TRANSACTION and save point : TRANSACTION ROLLBACK « Transaction « SQL / MySQL






TRANSACTION and save point


Drop table Books;


CREATE TABLE Books
(
   ID SMALLINT NOT NULL PRIMARY KEY,
   Title VARCHAR(60) NOT NULL,
   Copyright YEAR NOT NULL
)
ENGINE=INNODB;

select * from Books;

START TRANSACTION;
INSERT INTO Books VALUES (3, 'Angels', 1966);
INSERT INTO Books VALUES (4, 'Black', 1932);
SAVEPOINT sp1;

select * from Books;


           
       








Related examples in the same category

1.TRANSACTION and ROLLBACK
2.ROLL Back to the save point