Database Reference
In-Depth Information
Figure 16.5
The MUSIC
Schema ARTIST
Table
INSTRUMENTS
COLLECTION
Datatype.
, ZIP CHAR(10), EMAIL VARCHAR2(32)
, INSTRUMENTS INSTRUMENTSCOLLECTION
, CONSTRAINT XPKARTIST PRIMARY KEY (ARTIST_ID));
CREATE UNIQUE INDEX XUK_ARTIST_NAME ON ARTIST (NAME);
Accessing the collection from the ARTIST table is shown following. The
result is shown in Figure 16.5. PL/SQL can be used to access individual
VARRAY elements. See Chapter 24 for details on PL/SQL.
SELECT INSTRUMENTS FROM ARTIST;
16.2.4.2
Using Nested Table Collections
A nested table is effectively created as a table within another table. You will
notice in this section frequent use of the keyword TABLE. The TABLE key-
word is used to access the table within the table, the former being the
nested table object collection or dynamic array.
For the purposes of example, we create yet another copy of the ARTIST
table, except this time we use a nested table collection as opposed to a
Search WWH ::




Custom Search