Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Als je selectief tabellen uit een schema wil droppen kan het handig zijn om een drop script te genereren en daarna deze aan te passen en uit te voeren. Met de volgende scripts kan je drop statements genereren voor tabellen en views.

Code Block
languagesql
titleDrop Tables
select 'drop table '||table_name||' CASCADE CONSTRAINTS;' from USER_TABLES order by TABLE_NAME;


Code Block
languagesql
titleDrop Views
select 'drop view '||view_name||' CASCADE CONSTRAINTS;' from USER_VIEWS order by VIEW_NAME;


Code Block
languagesql
titleDrop Trigger
select 'drop trigger '||trigger_name||';' from USER_TRIGGERS order by TRIGGERS_NAME;


Code Block
languagesql
titleDrop Procedures
select 'drop procedure '||object_name||';' from USER_PROCEDURES where OBJECT_TYPE='PROCEDURE' order by OBJECT_NAME;


Code Block
languagesql
titleDrop Sequences
select 'drop sequence '||sequence_name||';' from USER_SEQUENCES order by SEQUENCE_NAME;