December 2010
Intermediate to advanced
451 pages
11h 16m
English
You need to remove one or more items from the end of a non-INDEX BY collection. The DELETE method will not work because it applies only to INDEX BY collections.
Use the TRIM method to remove one or more elements from the end of the collection. In this example, a VARRY is initialized with five elements. The TRIM method is used to remove elements from the end of the collection.
DECLARE
TYPE vtype IS VARRAY(5) OF DATE;
vdates vtype := vtype (sysdate, sysdate+1, sysdate+2, sysdate+3, sysdate+4);
BEGIN
DBMS_OUTPUT.PUT_LINE ('vdates size is: ' || vdates.COUNT);
vdates.TRIM;
DBMS_OUTPUT.PUT_LINE ('vdates size is: ' || vdates.COUNT);
vdates.TRIM(2); DBMS_OUTPUT.PUT_LINE ('vdates size ...Read now
Unlock full access