oracle清空表

1。先清空这些
BEGIN
for c1 in(select table_name from USER_TABLES where table_name not in ('T_ACL','T_CODE','T_DICTIONALYEGIS','T_MIJIACL','T_MODULE','T_ORGACL','T_ORGANIZATION','T_PERSON','T_ROLE','T_UR','T_USER','T_YEAR','T_DIG_PHOTOGROUP','T_FILING_PHOTOGROUP','T_SAVE_PHOTOGROUP','T_USE_PHOTOGROUP'))
loop
		execute immediate('truncate table '||c1.table_name);
end loop;
end;





2。再清空这些
BEGIN
for c1 in(select table_name from USER_TABLES where table_name in ('T_DIG_PHOTO','T_FILING_PHOTO','T_SAVE_PHOTO','T_USE_PHOTO'))
loop
		execute immediate('truncate table '||c1.table_name);
end loop;
end;

你可能感兴趣的:(oracle)