Database Reference
In-Depth Information
Figure 16.6
Retrieving the
Contents of a
Nested Table
Collection Object.
UPDATE ARTIST3 SET INSTRUMENTS = NEWCOLLECTION('Percussion')
WHERE ARTIST_ID = 13;
UPDATE ARTIST3 SET INSTRUMENTS = NEWCOLLECTION('Drums') WHERE
ARTIST_ID = 14;
UPDATE ARTIST3 SET INSTRUMENTS = NEWCOLLECTION('Acoustic
Guitar') WHERE ARTIST_ID = 15;
This is how items are retrieved from a nested table collection. Figure
16.6 shows the result.
SELECT INSTRUMENTS FROM ARTIST3 WHERE ARTIST_ID = 1;
SELECT * FROM TABLE(SELECT INSTRUMENTS FROM ARTIST3 WHERE
ARTIST_ID = 1);
16.2.5
Object Collection Functions
In the previous two sections entitled “Using VARRAY Collections” and
“Using Nested Table Collections,” you may have noticed some rather odd
scripting, or at least convoluted and overly complicated scripting. There are
object collection functions that can make things easier, particularly when
dealing with VARRAY and nested table objects at the same time. These
object collection functions are the following:
Search WWH ::




Custom Search