OCP 1Z0-051 172

(172)The SQL statements executed in a user session are as follows:

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;

DELETE FROM product WHERE pcode=10;

Which two statements describe the consequences of issuing the ROLLBACK TO SAVE POINT a command in the session? (Choose two.)

A. The rollback generates an error.

B. No SQL statements are rolled back.

C. Only the DELETE statements are rolled back.

D. Only the second DELETE statement is rolled back.

E. Both the DELETE statements and the UPDATE statement are rolled back.

答案:(A、B)

解析:

执行完commit语句后,保存点a已经被释放。

--1. DML操作

scott@TESTDB11>delete from emp1 where empno = 7369;

1 row deleted.

--2. 创建保存点

scott@TESTDB11>savepoint sp_delete;

Savepoint created.

--3. 提交

scott@TESTDB11>commit;

Commit complete.

--4. 回滚到前面创建的保存点出错,因为事务已经提交,保存点已经释放

scott@TESTDB11>rollback to sp_delete;

rollback to sp_delete

*

ERROR at line 1:

ORA-01086: savepoint 'SP_DELETE' never established in this session or is invalid



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1174326/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17013648/viewspace-1174326/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值