Skip to content

Instantly share code, notes, and snippets.

View ChrisMorrisCo's full-sized avatar

Chris Morris ChrisMorrisCo

View GitHub Profile
@azz
azz / Procedure-CLEANOUT.sql
Created October 24, 2012 10:52
Procedure "CLEANOUT"
CREATE OR REPLACE PROCEDURE "CLEANOUT" AS
-- Drop FK restraints (type = ''R') so tables can be dropped in any order
cursor con_cursor IS
SELECT rtrim(constraint_name) as conname, rtrim(table_name) as tabname
FROM user_constraints
WHERE rtrim(constraint_type) = 'R';
-- Leave some objects to prevent problems when objects are dropped out of order
-- Do not drop indexes, they will go with tables