使用动态sql即可。
sql string(200);
 ...
begin 
  sql := 'delete ....';
  execute immediate sql;
  sql := 'create ...';
  ...------------------------
不过你的这种做法不可取,因为会产生大量的碎片,而oracle是不会自动整理数据库碎片的。
建议使用临时表

解决方案 »

  1.   

    动态sql,我在论坛里发个一个函数,关于动态建表的,你自己搜一下.
      

  2.   

    http://community.csdn.net/Expert/topic/3123/3123391.xml?temp=.3823511
      

  3.   

    create or replace procedure create_Temp_Table isstr varchar2(100);begin
     str := 'create table admin.TEMP_TABLE(ID NUMBER(10) not null,A VARCHAR2(50))'; 
    execute immediate str;end create_Temp_Table;为何,我在PL/SQL Developer中这样写可以正常执行,却无法创建表TEMP_TABLE呢?
      

  4.   

    ok了,但我要如何去判断此表(TEMP_TABLE)是否存在呢?
      

  5.   

    to : jiezhi(風依舊)
    要如何人工处理数据库的碎片呢?
    用临时表,在我这里实际运用中不合适!
      

  6.   

    select count(*) into counter from user_all_tables where table_name='temp_table';
    if counter>0 then
      --存在
    else
      --不存在
    end if;