如果某个用户下所有表或指定表中所有的数据已确定不再需要,此时可以进行批量 truncate


declare cursor cur_trunc
is
select table_name from user_tables;
begin
for cur_del in cur_trunc loop
execute immediate 'truncate table '||cur_del.table_name;
end loop;
end;

 

由此可以引申到,删除表 drop 删除表中数据 delete 将 truncate 替换即可

select table_name from user_tables;
此句中可以对在后面加where 条件 指定 like 查询某类的表

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2021-07-25
  • 2022-02-28
  • 2022-01-23
  • 2021-11-30
  • 2021-06-04
相关资源
相似解决方案