作业帮 > 英语 > 作业

rollbackExamine the structure of the EMPLOYEES table:EMPLOYE

来源:学生作业帮 编辑:拍题作业网作业帮 分类:英语作业 时间:2024/04/29 12:54:06
rollback
Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
You issue these statements:
CREATE table new_emp ( employee_id NUMBER,name VARCHAR2(30));
INSERT INTO new_emp SELECT employee_id ,last_name from employees;
Savepoint s1;
UPDATE new_emp set name = UPPER(name);
Savepoint s2;
Delete from new_emp;
Rollback to s2;
Delete from new_emp where employee_id =180;
UPDATE new_emp set name = 'James';
Rollback to s2;
UPDATE new_emp set name = 'James' WHERE employee_id =180;
Rollback;
At the end of this transaction,what is true?
A.You have no rows in the table.
B.You have an employee with the name of James.
C.You cannot roll back to the same savepoint more than once.
D.Your last update fails to update any rows because employee ID 180 was already deleted.
Answer:A
这个回滚到什么地方 不是回到s1
Savepoint 就是设置一个 "保存点", 可以 Rollback to 到这个点上面
如果 commit 了, 那么所有的 Savepoint 就没用了.
如果 Rollback . 没有指定 Rollback 到哪一个点上.
意味着 全部 Rollback
所以,答案是 You have no rows in the table