A tiny MongoDB Browser Shell : http://try.mongodb.org/
The MongoLab : https://mongolab.com/
Oracle, Microsoft, MySQL help and tips.
A tiny MongoDB Browser Shell : http://try.mongodb.org/
The MongoLab : https://mongolab.com/
SELECT t.constraint_name, t.constraint_type, ct.column_name
FROM user_constraints t
INNER JOIN user_cons_columns ct on ct.constraint_name = t.constraint_name
WHERE t.table_name = '?' AND t.constraint_type = 'U' AND ct.column_name = '?';
BEGIN
--Bye Views!
FOR i IN (SELECT view_name FROM USER_VIEWS) LOOP
EXECUTE IMMEDIATE 'drop view'|| i.view_name ||'';
END LOOP;
--Bye Sequences!
FOR i IN (SELECT sequence_name FROM USER_SEQUENCES) LOOP
EXECUTE IMMEDIATE 'drop sequence '|| i.sequence_name ||'';
END LOOP;
--Bye Constraints!
FOR i IN (SELECT table_name, constraint_name FROM USER_CONSTRAINTS WHERE constraint_type='r') LOOP
EXECUTE IMMEDIATE 'alter table '|| i.table_name ||' DROP CONSTRAINT '||i.constraint_name;
--Bye Tables!
FOR i IN (SELECT table_name FROM USER_TABLES) LOOP
EXECUTE IMMEDIATE 'drop table '|| i.table_name ||' CASCADE CONSTRAINTS ';
END LOOP;
END;