Listing 3: Multilevel Collections with Anonymous Columns


1  CREATE OR REPLACE PROCEDURE set_steven_nicknames
 2  IS
 3      steven_nicknames        nicknames.nickname_set_t;
 4      universal_nicknames     nicknames.multiple_sets_t;

 5  BEGIN
 6     steven_nicknames (99) (1000) := 'Steve';
 7     steven_nicknames
 8        (nicknames.from_colleagues) (2000) := 'Troublemaker';
 9     steven_nicknames
10        (nicknames.from_colleagues) (3000) := 'All-around Great Guy';

11     steven_nicknames
12        (nicknames.from_family) (789) := 'Whiner';
13
14
15     universal_nicknames (nicknames.american_english) := 
16        steven_nicknames;
17     universal_nicknames (nicknames.french) :=

18        nicknames.to_french (steven_nicknames);
19     universal_nicknames (nicknames.german) :=
20        nicknames.to_german (steven_nicknames);
21     universal_nicknames (nicknames.arabic) :=
22        nicknames.to_arabic (steven_nicknames);
23
24     DBMS_OUTPUT.PUT_LINE (
25        universal_nicknames

26          (nicknames.american_english)
27          (nicknames.from_colleagues)
28          (2000));
29
30     DBMS_OUTPUT.PUT_LINE (
31        universal_nicknames(1005)(111)(2000));
32* END;