Database Reference
In-Depth Information
Figure 16.1
REF Stored the
Pointer Value
between Tables.
UPDATE ARTIST2 A2 SET A2.ADDRESS = (
SELECT REF(AD) FROM ADDRESSES AD JOIN ARTIST A
ON(AD.STREET = A.STREET)
WHERE A.ARTIST_ID = A2.ARTIST_ID);
The following script finds the REF pointer for each address in the new
artists table, between the ARTIST2 and ADDRESSES tables. The result is
shown in Figure 16.1.
SELECT NAME, ADDRESS FROM ARTIST2;
Now we could use the DEREF function to dereference or access the
value in the ADDRESSES table for each row in the ARTISTS2 table. The
result is shown in Figure 16.2.
Other less-used REF pointer functions are MAKE_REF, VALUE, and
REFTOHEX.
16.2.2.2
Using the BFILE Datatype
As already stated, a BFILE datatype is used as a pointer to a binary object,
such as multimedia, stored externally to a database. The MUSIC schema
 
Search WWH ::




Custom Search