Use of Other
Built-in Methods for Collections
FIRST and LAST -- Return the smallest and
largest index numbers for the collection referenced. Naturally, they
return null if the collection is empty. For VARRAYS FIRST always
returns 1, for nested tables FIRST returns the value of the first
filled spot for that entry. LAST returns the last filled instance of
a VARRAY and a nested table. For a VARRAY COUNT will always equal
LAST. For a nested table they can be different but LAST should
always be greater than COUNT if they are different for a nested
table.
PRIOR and NEXT -- Return the prior or next value
based on the input value for the collection index. PRIOR and NEXT
ignore deleted instances in a collection.
EXTEND -- Appends instances to a collection.
EXTEND has three forms, EXTEND, which adds one null instance,
EXTEND(n) which adds "n" null instances and EXTEND(n,m) which
appends N copies of instance "m" to the collection. For not null
specified collections forms one and two cannot be used.