虚谷数据库 批量 删除 表
declare
v_sql varchar(1000);
v_tablename varchar(1000);
cursor names is select TABLE_NAME as t_name from dba_tables t inner join dba_schemas s on t.schema_id = s.schema_id where s.schema_name = 'root' ;
begin
open names;
loop
fetch names into v_tablename;
EXIT WHEN names%NOTFOUND;
v_sql := 'drop table `root`.`' || v_tablename || '` ';
execute immediate v_sql;
end loop;
close names;
end;
————————————————
版权声明:本文为CSDN博主「两只耳朵跳起来」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/xujingcheng123/article/details/105865377
相关文章