用SQL语句删除所有表和SEQUENCE

For table:

SELECT
 'DROP TABLE '
 ||
 TABLE_NAME
 ||
 ' CASCADE CONSTRAINTS;'
 FROM
 user_tables;

 

For sequence:

 

SELECT 'DROP SEQUENCE ' || sequence_name || ';' FROM user_sequences;

 

运行以上命令将会生成一系列DROP TABLE/SEQUENCE 语句, 然后ctrl+A, ctrl+C, ctrl+V, 运行, 不需要手动一个个删除.

 

你可能感兴趣的:(DataBase&SQL)