ITPub博客

首页 > 数据库 > 数据库开发技术 > temp表学习笔记

temp表学习笔记

原创 数据库开发技术 作者:jixuewen 时间:2008-01-30 09:58:23 0 删除 编辑

temp表学习笔记:
create global temporary table temp_table_session
on commit preserve rows
as
select * from scott.emp where 1=0

create global temporary table temp_table_transaction
on commit delete rows
as
select * from scott.emp where 1=0
/


insert into temp_table_session select * from scott.emp;

insert into temp_table_transaction select * from scott.emp;

select session_cnt, transaction_cnt
from ( select count(*) session_cnt from temp_table_session ),
( select count(*) transaction_cnt from temp_table_transaction );

HR 30-1月 -08 >select session_cnt, transaction_cnt
2 from ( select count(*) session_cnt from temp_table_session ),
3 ( select count(*) transaction_cnt from temp_table_transaction );

SESSION_CNT TRANSACTION_CNT
----------- ---------------
14 0

HR 30-1月 -08 >disc
从 Personal Oracle Database 10g Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options 断开
30-1月 -08 >conn hr/hr
已连接。
HR 30-1月 -08 >select session_cnt, transaction_cnt
2 from ( select count(*) session_cnt from temp_table_session ),
3 ( select count(*) transaction_cnt from temp_table_transaction );

SESSION_CNT TRANSACTION_CNT
----------- ---------------
0 0

意思自己理解,只是将学习的东西记录下来。回头有脚本可看。

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/564597/viewspace-998742/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 升职了
请登录后发表评论 登录
全部评论
  • 博文量
    95
  • 访问量
    2007549