我是靠谱客的博主 务实康乃馨,这篇文章主要介绍Oracle 清库脚本,现在分享给大家,希望可以做个参考。

清库脚本一份

表dossier_group 的字段Dossier_Table存储的是要清空的表


DECLARE
tsql varchar2(500);
countI number;
begin
FOR I IN (select * from dossier_group ) LOOP
select count(*) into countI from user_tables where table_name=upper(I.Dossier_Table) ;
if countI > 0 then
tsql:= 'TRUNCATE TABLE '||I.Dossier_Table ;
DBMS_OUTPUT.PUT_LINE(tsql);
execute immediate tsql;
end if;

END LOOP;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
end;

最后

以上就是务实康乃馨最近收集整理的关于Oracle 清库脚本的全部内容,更多相关Oracle内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(120)

评论列表共有 0 条评论

立即
投稿
返回
顶部