您的位置:首页 > 博客中心 > 数据库 >

Oracle删除当前用户下的所有表或数据

时间:2022-03-10 18:15

create or replace procedure pro_droptable is
cursor cur is select table_name from user_tables;
drop_sql varchar2(1000);
begin
  for tbname in cur loop
    begin
      drop_sql:=‘drop table ‘||tbname.table_name;--将drop修改为truncate即可删除所有表的数据
      execute immediate drop_sql;
    end;
  end loop;
end pro_droptable;

 

Oracle删除当前用户下的所有表或数据,布布扣,bubuko.com

热门排行

今日推荐

热门手游