develog

[MySql] Transaction Test 본문

DB/MySQL

[MySql] Transaction Test

냐옴 2013. 12. 12. 21:13
CREATE TABLE TEST1 (
SEQ INTEGER PRIMARY KEY AUTO_INCREMENT
, TITLE VARCHAR(100)
) ENGINE INNODB
;

CREATE TABLE TEST2 (
SEQ INTEGER PRIMARY KEY AUTO_INCREMENT
, TITLE VARCHAR(100)
) ENGINE INNODB
;

ALTER TABLE TEST1 ENGINE INNODB;
ALTER TABLE TEST2 ENGINE INNODB;

START TRANSACTION;
INSERT INTO TEST1 (TITLE) VALUES ('11');
INSERT INTO TEST1 (TITLE) VALUES ('22');
INSERT INTO TEST2 (TITLE) VALUES ('33');
INSERT INTO TEST2 (TITLE) VALUES ('44');
ROLLBACK;

SELECT * FROM TEST1;
SELECT * FROM TEST2;

DELETE FROM TEST1;
DELETE FROM TEST2;


'DB > MySQL' 카테고리의 다른 글

MySql CharSet 관련  (0) 2014.04.05
iBatis, MySQL insert 후 insert Id 가져오기  (0) 2013.12.13
[MySql] CREATE TABLE ENGINE  (0) 2013.12.12
MySQL insert 시 한글 깨질 때 해결방법  (0) 2013.12.12
MySQL JDBC 한글 깨짐  (0) 2013.12.11
Comments