declare
v_new_tab_name varchar2(35);
for tn in (select table_name from user_tables) loop
begin
execute immediate ( 'truncate table '||tn.Table_Name );
exception
when others then
v_new_tab_name := '"' || tn.Table_Name|| '"' ;
execute immediate (' truncate table '||v_new_tab_name) ;
end ;
end loop;
end;
orcale删除全部表数据
declare
v_new_tab_name varchar2(35);
for tn in (select table_name from user_tables) loop
begin
execute immediate ( 'truncate table '||tn.Table_Name );
exception
when others then
v_new_tab_name := '"' || tn.Table_Name|| '"' ;
execute immediate (' truncate table '||v_new_tab_name) ;
end ;
end loop;
end;