Oracle--指定対象削除

–delete tables
Sql代码
select ‘drop table ’ || table_name ||’;’||chr(13)||chr(10) from user_tables;

select ‘drop table ’ || table_name ||’;’||chr(13)||chr(10) from user_tables;
–delete views
Sql代码
select ‘drop view ’ || view_name||’;’||chr(13)||chr(10) from user_views;

select ‘drop view ’ || view_name||’;’||chr(13)||chr(10) from user_views;

–delete seqs
Sql代码
select ‘drop sequence ’ || sequence_name||’;’||chr(13)||chr(10) from user_sequences;

select ‘drop sequence ’ || sequence_name||’;’||chr(13)||chr(10) from user_sequences;

–delete functions
Sql代码
select ‘drop function ’ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=‘FUNCTION’;

select ‘drop function ’ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=‘FUNCTION’;

–delete procedure
Sql代码
select ‘drop procedure ’ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=‘PROCEDURE’;

select ‘drop procedure ’ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=‘PROCEDURE’;

–delete package
Sql代码
select ‘drop package ’ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=‘PACKAGE’;

select ‘drop package ’ || object_name||’;’||chr(13)||chr(10) from user_objects where object_type=‘PACKAGE’;

Oracle--指定対象削除Oracle--指定対象削除 DB王子様 发布了15 篇原创文章 · 获赞 2 · 访问量 172 私信 关注
上一篇:Python 中英文混输格式对齐问题


下一篇:团体程序设计天梯赛-练习集(二)