--删除表结构
declare
cursor c_t is (select table_name from user_tables);--声明一个游标table_name user_tables.table_name%type;--声明一个表名的变量
begin
open c_t;
loop--循环
fetch c_t into table_name;
exit when c_t%notfound;
execute immediate 'drop table ' || table_name;--动态sql删除
end loop;
close c_t;
end;
--清空表
- declare
- cursor c_t is (select table_name from user_tables);--声明一个游标
- table_name user_tables.table_name%type;--声明一个表名的变量
- begin
- open c_t;
- loop—循环
- fetch c_t into table_name;
- exit when c_t%notfound;
- execute immediate 'delete from ' || table_name;--动态sql删除
- end loop;
- close c_t;
- end;