temp表學習筆記

jixuewen發表於2008-01-30

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章