Object References (Cont.)
The VALUE DML Operator
- It returns the object stored in an object table.
- It only works on row objects.
- It returns an instance.
SQL> SELECT * FROM persons p;
NAME SSN DOB
-------------------------------- ---------- ---------
Powerpuff Girls 123456789 31-OCT-80
Kids Next Door 234567890 20-FEB-00
SQL> SELECT VALUE( p ) FROM persons p;
VALUE(P)(NAME, SSN, DOB)
---------------------------------------------------------
PERSON_TYP('Powerpuff Girls', 123456789, '31-OCT-80')
PERSON_TYP('Kids Next Door', 234567890, '20-FEB-00')
|
|
Dangling Reference
It happens if the target object of a
REF
is removed.
SQL> DELETE FROM persons p WHERE p.ssn = 123456789;
1 row deleted.
SQL> SELECT no FROM accounts WHERE acc_holder IS DANGLING;
NO
----------
1001
|
|
The predicate
IS DANGLING
returns
TRUE
when applied to a deleted REF
items, or
FALSE
when applied to an existing REF
object.