Oracle allows you to delete an object that is the target of the
REF
without deleting the reference to it.
For example, if an object is referenced within an object table, Oracle allows you to delete a record from the object, which is referenced within the object table.
Oracle qualifies this state with a name: a
dangling REF
.
This is roughly equivalent to what would happen if you deleted a department record without changing the records of the employees within the department.
For example, the
SALE_HEADER
object references the
CUSTOMER_TYPE
object.
If a sale has been made to Anne Nicole and the record within
CUSTOMER_TYPE
for Anne Nicole is deleted,
the sale record associated with that name is referred to as
dangling.
There is no declarative way to prevent dangling
REFs
, but Oracle allows you to identify such records by using the
IS DANGLING
clause within SQL.
The following diagram explains the variables in the syntax: