既然是临时表,为什么还要删掉?会话级的临时表创建方法:create global temporary table table_name(col1 type1,col2 type2...) on commit preserve rows;举例create global temporary table student(stu_id number(5),class_id  number(5),stu_name varchar2(8),stu_memo varchar2(200)) on commit preserve rows ;事务级临时表的创建方法:create global temporary table table_name(col1 type1,col2 type2...) on commit delete rows;举例:create global temporary table classes(class_id number(5),class_name varchar2(8),class_memo varchar2(200)) on commit delete rows ;你可以创建基于session和基于事务的临时表,基于session的临时表当你session断开,表中数据将被自动删除。

解决方案 »

  1.   

    照个人理解来看,你的意思只能建基于session的临时表,在过程开始创建,处理之后--》commit--》drop,如果是这样的话,应该用动态sql来创建表,在创建之后drop(同理,也用动态sql来drop表)动态sql
    execute immediate 'create global temporary table t(col1 ...)';
    ...;
    commit;
    execute immediate 'drop table t';
      

  2.   

    to:fhtt0606(Java追随者!)
    就按照你创建的这个,我如果在后面:select * from t,在编译时就会有表名不存在的错误提示。
      

  3.   

    我的意思是创建表是可以编译通过的,但是如果后面需要查询这个表等(只要是对这个表的操作)都会提示表名不存在!(登录ORACLE的用户是有创建表的权限的)
      

  4.   

    加上这条语句试一下.
    authid current_user