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.创建了一个基于会话的临时表;插入一行数据;提交;数据只会在当前会话看到,其他会话看不到,如果结束会话,数据被删除。
不管是基于会话的临时表,还是基于事务的临时表,只要关闭会话(关闭会话也会结束事务),数据都会被删除。
提示:答案为个人理解和解答,难免有错,也欢迎大家及时指正。