以下在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 
各位大哥,临时表创建 是不能同时插入数据?临时表

解决方案 »

  1.   

    CREATE GLOBAL TEMPORARY TABLE today_sales
       ON COMMIT PRESERVE ROWS 
       AS
      

  2.   

    hr@ORCL> create global temporary table ttt as select * from user_tables where rownum=1;Table created.
      

  3.   

    hr@ORCL> select * from ttt;no rows selectedhr@ORCL> create global temporary table ttt1 on commit delete rows as select * from user_tables where rownum=1;Table created.hr@ORCL> select * from ttt1;no rows selected
      

  4.   

    hr@ORCL> create global temporary table ttt2 on commit preserve rows as select * from user_tables where rownum=1;Table created.hr@ORCL> select * from ttt2;TABLE_NAME                     TABLESPACE_NAME                CLUSTER_NAME
    ------------------------------ ------------------------------ ------------------------------
    IOT_NAME                       STATUS     PCT_FREE   PCT_USED  INI_TRANS  MAX_TRANS INITIAL_EXTENT
    ------------------------------ -------- ---------- ---------- ---------- ---------- --------------
    NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE  FREELISTS FREELIST_GROUPS LOG B   NUM_ROWS
    ----------- ----------- ----------- ------------ ---------- --------------- --- - ----------
        BLOCKS EMPTY_BLOCKS  AVG_SPACE  CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS
    ---------- ------------ ---------- ---------- ----------- -------------------------
    NUM_FREELIST_BLOCKS DEGREE
    ------------------- ----------------------------------------
    INSTANCES                                CACHE                TABLE_LO SAMPLE_SIZE
      

  5.   

    强大啊,感谢阿,也解决了为什么用php 不能得到临时表数据的问题,请继续去下面贴子接分http://bbs.csdn.net/topics/390382133
    http://bbs.csdn.net/topics/390382117
    http://bbs.csdn.net/topics/390382125
      

  6.   

    对不起呀,请版大去 结分
    http://bbs.csdn.net/topics/390382133
    http://bbs.csdn.net/topics/390382117
    http://bbs.csdn.net/topics/390382125