When a REF value points to a nonexistent object, the REF is said to be "dangling". A dangling REF is different from a null REF. To determine whether a REF is dangling or not, use the condition IS [NOT] DANGLING.
DANGLING
conn oe/oe
SELECT o.customer_ref.cust_email
FROM oc_orders o
WHERE o.customer_ref IS NOT DANGLING;
SELECT o.customer_ref.cust_email
FROM oc_orders o
WHERE o.customer_ref IS DANGLING;
Takes a correlation variable (table alias) associated with a row of an object table or an object view. A REF value is returned for the object instance that is bound to the variable or row.
REF(<correlation_variable>)
See Demo below
Referential Constraint
Demo
Foreign Key Without OID Reference
CREATE OR REPLACE TYPE
cust_address_t AS OBJECT (
street_address VARCHAR2(40),
postal_code VARCHAR2(10),
city VARCHAR2(30),
state_province VARCHAR2(2),
country_id VARCHAR2(2));
/
CREATE TABLE address_table OF cust_address_t;
desc address_table
INSERT INTO address_table
VALUES ('123 Main St.','98040','Mercer Island','WA','US');
INSERT INTO address_table
VALUES ('1 Broadway','10202','New York','NY','US');
INSERT INTO address_table
VALUES ('2462 Edgar Crest','V6L 2C4','Vancouver','BC','CN');