我正在尝试在 Oracle 11g 中创建一个保存点。
ALTER TABLE ORDERS
DISABLE CONSTRAINT ORDERS_C_ID_FK;
DELETE FROM CUSTOMER;
SELECT * FROM CUSTOMER;
ROLLBACK;
SELECT * FROM CUSTOMER;
SAVEPOINT SAVEPOINT1;
ALTER TABLE ORDERS
DISABLE CONSTRAINT ORDERS_OS_ID_FK;
ALTER TABLE ORDER_LINE
DISABLE CONSTRAINT ORDER_LINE_O_ID_FK;
TRUNCATE TABLE CUSTOMER;
TRUNCATE TABLE ORDER_SOURCE;
TRUNCATE TABLE ORDERS;
DELETE FROM ORDERS;
ROLLBACK TO SAVEPOINT1;
但我不断从 SQL Developer 收到此错误
ROLLBACK TO SAVEPOINT1 错误报告:SQL 错误:ORA-01086:保存点 'SAVEPOINT1' 从未在此会话中建立或无效 01086. 00000 - “保存点 '%s' 从未建立” *原因:试图回滚到一个保存点从未成立。*行动: