ORA-06533: Subscript beyond count

ORA-06533: Subscript beyond count

Cause: An in-limit subscript was greater than the count of a varray 
or too large for a nested table.

Action: Check the program logic and explicitly extend if necessary.
CREATE OR REPLACE TYPE l_rec_type IS OBJECT (id NUMBER, name VARCHAR2 (4000));
/
CREATE OR REPLACE TYPE l_tab_type IS TABLE OF l_rec_type;
/
DECLARE

  l_tab l_tab_type;

 BEGIN

   l_tab := l_tab_type();

  l_tab.EXTEND(2);

  l_tab(1) := l_rec_type(1,'Ashish');

  l_tab(2) := l_rec_type(2,'Sahay');

  l_tab(3) := l_rec_type(3,'Beyond count');

 END;

/

Now when we remove the beyond count entry

DECLARE
  l_tab l_tab_type;

 BEGIN

   l_tab := l_tab_type();

  l_tab.EXTEND(2);

  l_tab(1) := l_rec_type(1,'Ashish');

  l_tab(2) := l_rec_type(2,'Sahay');

--  l_tab(3) := l_rec_type(3,'Beyond count');

 END;
/