Example 1: Deleting a domain not referred to by columns SQL> -- SQL> -- The following CREATE DOMAIN statement creates a domain SQL> -- that is not used by any columns: SQL> -- SQL> CREATE DOMAIN ABCD IS CHAR(4); SQL> -- SQL> -- The SHOW DOMAINS statement shows domain ABCD at the SQL> -- top of the list: SQL> -- SQL> SHOW DOMAINS User domains in database with filename personnel ABCD CHAR(4) ADDRESS_DATA_1_DOM CHAR(25) ADDRESS_DATA_2_DOM CHAR(20) . . . SQL> -- SQL> -- Now delete the domain: SQL> -- SQL> DROP DOMAIN ABCD; SQL> -- SQL> -- The SHOW DOMAINS statement shows that the SQL> -- domain ABCD has been deleted: SQL> -- SQL> SHOW DOMAINS User domains in database with filename personnel ADDRESS_DATA_1_DOM CHAR(25) ADDRESS_DATA_2_DOM CHAR(20) . . . Example 2: Deleting a domain referred to by columns The following example deletes a domain definition. Because a column refers to the domain definition and a constraint refers to the column, you must first alter the table before deleting the domain. SQL> -- SQL> -- Attempt to delete the domain SEX_DOM. Error messages SQL> -- indicate that the table EMPLOYEES uses the domain SQL> -- SEX_DOM, so SEX_DOM cannot yet be deleted: SQL> -- SQL> DROP DOMAIN SEX_DOM; %RDB-E-NO_META_UPDATE, metadata update failed -RDMS-F-RELEXI, field SEX_DOM is used in relation EMPLOYEES -RDMS-F-FLDNOTDEL, field SEX_DOM has not been deleted SQL> -- SQL> -- Looking at the EMPLOYEES table shows that SEX is the SQL> -- column that depends on the domain SEX_DOM. Try SQL> -- to delete the column SEX; error messages indicate that the SQL> -- constraint EMP_SEX_VALUES depends on the column SEX: SQL> -- SQL> ALTER TABLE EMPLOYEES DROP COLUMN SEX; %RDB-E-NO_META_UPDATE, metadata update failed -RDMS-F-FLDINCON, field SEX is referenced in constraint EMP_SEX_VALUES -RDMS-F-RELFLDNOD, field SEX has not been deleted from relation EMPLOYEES SQL> -- SQL> -- Delete the constraint EMP_SEX_VALUES: SQL> -- SQL> ALTER TABLE EMPLOYEES DROP CONSTRAINT EMP_SEX_VALUES; SQL> -- SQL> -- Because EMP_SEX_VALUES was the only constraint or index SQL> -- that depended on the column SEX, you can now delete SQL> -- the column SEX: SQL> -- SQL> ALTER TABLE EMPLOYEES DROP COLUMN SEX; SQL> -- SQL> -- The column SEX in the table EMPLOYEES was the only column in SQL> -- the database that depended on the domain SEX_DOM, so you can SQL> -- now delete the domain SEX_DOM: SQL> -- SQL> DROP DOMAIN SEX_DOM; SQL>