0
我學習SQL和考試準備的問題有一個用戶會話,像這樣:說明爲什麼以下SQL ROLLBACK命令會導致錯誤?
CREATE TABLE product (pcode NUMBER(2), pname VARCHAR2(10));
INSERT INTO product VALUES (1, 'pen');
INSERT INTO product VALUES (2, 'pencil');
SAVEPOINT a;
UPDATE product SET pcode = 10 WHERE pcode = 1;
SAVEPOINT b;
DELETE FROM product WHERE pcode = 2;
COMMIT;
SQL> DELETE FROM product WHERE pcode = 10;
以上之後,我們運行這個命令:
ROLLBACK TO SAVEPOINT a
根據測試-guide ,這會產生一個錯誤;也 - 沒有SQL語句回滾。
這是爲什麼?
其中是回滾命令?也是 - 這是預言嗎? – benji
@benji - 謝謝,添加了一個缺失的細節 – Coffee