hallo zusammen
ich habe einen lkeinen problem mit collection beim delete:
TYPE parent_child_typ IS RECORD(
parent_id INTEGER := 0,
child_id INTEGER := 0);
parent_child parent_child_typ;
TYPE master_table_type IS TABLE OF parent_child_typ;
master_table master_table_type := master_table_type();
bein einfügen ist kein priblem:
master_table.extend;–null am ende einfügen
master_table(master_table.last).parent_id := info;
master_table(master_table.last).child_id := info;
beim löschen taucht das problem erst beim 2 durchlauf!!
value eroor:ora-06502
die ursachen:
a subscript is null or not convertible to the key type. This exception might occur if the key is defined as a PLS_INTEGER range, and the subscript is outside this range
FOR i IN master_table.FIRST … master_table.LAST
LOOP
if i = null then
null;
else
IF master_table(i).child_id = form_id.id THEN
master_table.delete(i);
END IF;
end if;
END LOOP;
wie soll ich mein schleife ändern damit ich diese fehler vermeide