Skip to content

Instantly share code, notes, and snippets.

@abezhinaru
Created May 16, 2018 14:05
Show Gist options
  • Save abezhinaru/3a0218969c0c3c0ef25ba47613b1b3d8 to your computer and use it in GitHub Desktop.
Save abezhinaru/3a0218969c0c3c0ef25ba47613b1b3d8 to your computer and use it in GitHub Desktop.
SELECT
'DROP' || ' ' || object_type || ' ' || object_name || ' ' || CASE(object_type)
WHEN 'TABLE' THEN 'CASCADE CONSTRAINTS;'
ELSE ';'
END
FROM user_objects
WHERE
object_type IN ('TABLE','VIEW','PACKAGE','PROCEDURE','FUNCTION','SEQUENCE');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment