Oracle Drop Table Examples

Given the following tables, we try to drop tables, obtaining this error:

SQL> select table_name from USER_TABLES;

TABLE_NAME
--------------------------------------------------------------------------------
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY

6 rows selected.
SQL>

SQL> drop table LOCATIONS;
drop table LOCATIONS
           *
ERROR at line 1:
ORA-02449: unique/primary keys in table referenced by foreign keys

So we have to include the following modificator:

drop table "FACTURATOR"."LOCATIONS" cascade constraints
Table dropped.