Home > Database > Mysql Tutorial > 删除当前用户的所有对象(表、视图、触发器、存储过程、函数)

删除当前用户的所有对象(表、视图、触发器、存储过程、函数)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:12:48
Original
1095 people have browsed it

DECLARE TYPE name_list IS TABLE OF VARCHAR2(40); TYPE type_list IS TABLE OF VARCHAR2(20); Tab_name name_list:=name_list(); Tab_type type_list:=type_list(); sql_str VARCHAR2(500); BEGIN sql_str := 'select uo.object_name,uo.object_type from



\DECLARE
\TYPE name_list IS TABLE OF VARCHAR2(40);
\TYPE type_list IS TABLE OF VARCHAR2(20);
\
\Tab_name name_list:=name_list();
\Tab_type type_list:=type_list();
\
\sql_str VARCHAR2(500);
\BEGIN
\sql_str := 'select uo.object_name,uo.object_type from user_objects uo where uo.object_type not in(''INDEX'',''LOB'') order by uo.object_type desc';
\EXECUTE IMMEDIATE sql_str BULK COLLECT INTO tab_name,tab_type;
\
\FOR i IN Tab_name.FIRST.. Tab_name.LAST LOOP
\sql_str := 'DROP ' || Tab_type(i) || ' ' || Tab_name(i);
\EXECUTE IMMEDIATE sql_str;
\END LOOP;
\END;
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template