日期:2014-05-17  浏览次数:20966 次

oracle临时表创建同时插入数据,是不行的?
以下在pl/sql测试

////////////////////////////正式表,创建/并插入一条数据 
create  table FS_TT
as
select * from FS where rownum=1


////////////////////////////临时表,创建/没有数据插入 
create  GLOBAL TEMPORARY table FS_TT2
as
select * from FS where rownum=1 


各位大哥,临时表创建 是不能同时插入数据?
临时表

------解决方案--------------------
CREATE GLOBAL TEMPORARY TABLE today_sales
   ON COMMIT PRESERVE ROWS 
   AS
------解决方案--------------------
hr@ORCL> create global temporary table ttt as select * from user_tables where rownum=1;

Table created.

------解决方案--------------------
临时表没用过,一般在处理大量数据时都是用正式表代替临时表,用完再清理掉