Object Type Dependencies
- Object types can have dependencies.
- Object types can not be dropped when they are being used in a table or column definition.
- Object type dependencies are maintained in the data dictionary view
%_DEPENDENCIES
(% stands for USER
or ALL
).
SQL> DROP TYPE address_typ;
DROP TYPE address_typ
*
ERROR at line 1:
ORA-02303: cannot drop or replace a type with type or table dependents
|
|
Data dictionary maintains system catalogs, tables that contain information about objects defined in the database.
SQL> DESC user_dependencies;
Name Null? Type
------------------------------- -------- ----------------------------
NAME NOT NULL VARCHAR2(30)
TYPE VARCHAR2(17)
REFERENCED_OWNER VARCHAR2(30)
REFERENCED_NAME VARCHAR2(64)
REFERENCED_TYPE VARCHAR2(17)
REFERENCED_LINK_NAME VARCHAR2(1212.
SCHEMAID NUMBER
DEPENDENCY_TYPE VARCHAR2(4)
SQL> SELECT name, referenced_name FROM user_DEPENDENCIES;
NAME REFERENCED_NAME
--------------------------- -------------------------------
DEPARTMENT_TYP EMPLOYEE_TYP
EMPLOYEE_TYP DEPARTMENT_TYP
SQL> DROP TYPE employee_typ FORCE;
|
|
To drop the cyclic object type, use the keyword
FORCE
.