oracle删除当前用户的表

删除用户的表:

declare 
  table_name varchar(100);
  drop_sql varchar(100);
cursor c1 is select table_name from user_tables;
begin
  open c1;
  loop
    fetch c1 into table_name;
     drop_sql:='drop table '||table_name;
    execute immediate drop_sql;
    dbms_output.put_line(table_name);
    exit when c1%NOTFOUND;
  end loop;
  close c1;
end;

 

posted @ 2014-07-03 11:21  地球之旅  阅读(139)  评论(0编辑  收藏  举报