1

I create a varray collection as CREATE OR REPLACE TYPE vary_typ IS VARRAY(40) OF NUMBER; / and form anonymous block like

DECLARE
  v_a vary_typ := vary_typ (1,3,5,6,34,67,50);
BEGIN
  FOR i IN v_a.FIRST..v_a.COUNT
  LOOP
   IF v_a.EXISTS(i) THEN
    v_a.DELETE(i);
   ELSE
    dbms_output.put_line(i);
   END IF;
   dbms_output.put_line(v_a);
  END LOOP;
END;
/

But could not delete it. I know varray can't be delete using .DELETE method only perform .TRIM. But my question, is there any possibility to delete element by convert it into INDEX BY TABLE then delete?

I already seen the post Delete element from Varray Oracle. There solution was different what i expected. I want to delete and make varray into sparse collection, can we?

Nvr
  • 171
  • 1
  • 11

0 Answers0