oracle数据库2种临时表的使用

1.会话级临时表:

会话级临时表是指临时表中的数据只在会话生命周期之中存在,当用户退出会话结束的时候,oracle自动清除临时表中数据。
格式如下:

Create Global Temporary Table Table_Name
(Col1 Type1,
Col2 Type2
...)
On Commit Preserve Rows;

2.事务级临时表:

事务级临时表是指临时表中的数据只在事务生命周期中存在,当一个事务结束(commit or rollback),oracle自动清除临时表中数据。
格式如下:

Create Global Temporary Table Table_Name
(Col1 Type1,
Col2 Type2
...)
On Commit Delete Rows;
posted @ 2018-08-06 19:40  夏天的棒棒冰  阅读(630)  评论(0编辑  收藏  举报