全局临时表创建与测试

--创建全局临时表
create global temporary table temp_table(id number,name varchar2(20))
on commit preserve rows; --只在同一个会话中有效

--测试代码如下:
SQL> create global temporary table temp_table(
2 id number,
3 name varchar2(20)
4 )
5 on commit preserve rows;

Table created

SQL> insert into temp_table(id,name) values(1,'全局临时表测试');

1 row inserted

SQL> commit;

Commit complete

SQL> select * from temp_table;

ID NAME
---------- --------------------
1 全局临时表测试

--另外打开一个"Command Window"窗口
SQL> select * from temp_table;

ID NAME
---------- --------------------
原文地址:https://www.cnblogs.com/huangbiquan/p/7763525.html