17,377
社区成员
发帖
与我相关
我的任务
分享
truncate table tablename 然后 insert into select * from 。。。
declare
sqlstr varchar2(999);
begin
for c in (select table_name from user_tables) loop
sqlstr := 'drop table '||c.table_name||' purge';
begin
execute immediate sqlstr ;
exception
when others then
dbms_output.put_line(c.table_name||'可能具有外键关联,自行确定是否删除');
end;
end loop;
end;
declare
sqlstr varchar2(999);
begin
for c in (select table_name from user_tables) loop
sqlstr := 'drop table '||c.table_name||' purge';
begin
execute immediate sqlstr ;
exception
when others then
dbms_output.put_line(c.table_name||'可能具有外键关联,自行确定是否删除');
end;
end loop;
end;
declare
sqlstr varchar2(999);
begin
for c in (select table_name from user_tables) loop
sqlstr := 'drop table '||c.tablename||' purge';
begin
execute immediate sqlstr ;
exception
when others then
dbms_output.put_line(c.tablename||'可能具有外键关联,自行确定是否删除');
end;
end loop;
end;