代码改变世界

12c OCP考试专项 [1z0-071]-Q12: 全局临时表(2020.06.17)

2020-06-17 22:40  askscuti  阅读(289)  评论(0编辑  收藏  举报

create global temporary table invoices_got(xxx)
on commit preserve rows.

insert into invoices_got values(1,100);

commit;

A. The session can add columns.
B. The session can add foreign keys.
C. Other sessions can view the committed row.
D. when you terminated your session, the row will be deleted.

Answer: D

Explanation:

关键字 on commit preserve rows.创建了一个基于会话的临时表;插入一行数据;提交;数据只会在当前会话看到,其他会话看不到,如果结束会话,数据被删除。
不管是基于会话的临时表,还是基于事务的临时表,只要关闭会话(关闭会话也会结束事务),数据都会被删除。

提示:答案为个人理解和解答,难免有错,也欢迎大家及时指正。