本帖最后由 dan 于 2020-2-8 10:36 编辑
临时只存在与临时表空间
1、会话级临时表,会话结束时就被删除了
create global temporary table table_name
(
col1 type1,
col2 type2,
...
)
on commit preserve rows;
例子:
create global temporary table session_t01
(
t01_name varchar2(10),
t01_age number
)
on commit preserve rows;
注:与其他表一样可以插入数据,只不过在当前sql窗口插入的数据,如果再打另一个sql窗口查看就是没有数据。
2、事务级临时表,在事务结束时(commit,rollback),清楚数据。
create global temporary table table_name
(
col1 type1,
col2 type2,
...
)
on commit delete rows; |