temp表学习笔记

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博客 ” ,链接:http://blog.itpub.net/564597/viewspace-998742/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/564597/viewspace-998742/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值