Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Collections
 

The DELETE Table Attribute

SQL> DECLARE   2    TYPE t_ValueTable IS TABLE OF VARCHAR2(10)   3      INDEX BY BINARY_INTEGER;   4    v_Values t_ValueTable;   5  BEGIN   6    -- Insert rows into the table.   7    v_Values(1) := 'One';   8    v_Values(3) := 'Three';   9    v_Values(-2) := 'Minus Two';  10    v_Values(0) := 'Zero';  11    v_Values(100) := 'Hundred';  12  13    v_Values.DELETE(100);  -- Removes 'Hundred'  14    v_Values.DELETE(1,3);  -- Removes 'One' and 'Three'  15    v_Values.DELETE;       -- Removes all remaining values  16  END;  17  / PL/SQL procedure successfully completed. SQL>